Class: Antigravity::Message

Inherits:
Base
  • Object
show all
Defined in:
lib/antigravity/message.rb

Direct Known Subclasses

Chunk

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inherited

Methods included from Emojifiable

#emoji, included

Constructor Details

#initialize(role: :assistant, content: "", thinking: "", tool_calls: [], model_id: nil) ⇒ Message

Returns a new instance of Message.



8
9
10
11
12
13
14
15
# File 'lib/antigravity/message.rb', line 8

def initialize(role: :assistant, content: "", thinking: "", tool_calls: [], model_id: nil)
  @role = role
  @content = content
  @thinking = thinking
  @tool_calls = tool_calls
  @model_id = model_id
  @tokens = { input: 0, output: 0 }
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



6
7
8
# File 'lib/antigravity/message.rb', line 6

def content
  @content
end

#model_idObject

Returns the value of attribute model_id.



6
7
8
# File 'lib/antigravity/message.rb', line 6

def model_id
  @model_id
end

#roleObject

Returns the value of attribute role.



6
7
8
# File 'lib/antigravity/message.rb', line 6

def role
  @role
end

#thinkingObject

Returns the value of attribute thinking.



6
7
8
# File 'lib/antigravity/message.rb', line 6

def thinking
  @thinking
end

#tokensObject

Returns the value of attribute tokens.



6
7
8
# File 'lib/antigravity/message.rb', line 6

def tokens
  @tokens
end

#tool_callsObject

Returns the value of attribute tool_calls.



6
7
8
# File 'lib/antigravity/message.rb', line 6

def tool_calls
  @tool_calls
end