Class: Rubyagents::ChatMessage

Inherits:
Data
  • Object
show all
Defined in:
lib/rubyagents/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(role:, content:, token_usage: nil, tool_calls: nil) ⇒ ChatMessage

Returns a new instance of ChatMessage.



36
37
38
# File 'lib/rubyagents/model.rb', line 36

def initialize(role:, content:, token_usage: nil, tool_calls: nil)
  super
end

Instance Attribute Details

#content ⇒ Object (readonly)

Returns the value of attribute content

Returns:

  • (Object) —

    the current value of content



35
36
37
# File 'lib/rubyagents/model.rb', line 35

def content
  @content
end

#role ⇒ Object (readonly)

Returns the value of attribute role

Returns:

  • (Object) —

    the current value of role



35
36
37
# File 'lib/rubyagents/model.rb', line 35

def role
  @role
end

#token_usage ⇒ Object (readonly)

Returns the value of attribute token_usage

Returns:

  • (Object) —

    the current value of token_usage



35
36
37
# File 'lib/rubyagents/model.rb', line 35

def token_usage
  @token_usage
end

#tool_calls ⇒ Object (readonly)

Returns the value of attribute tool_calls

Returns:

  • (Object) —

    the current value of tool_calls



35
36
37
# File 'lib/rubyagents/model.rb', line 35

def tool_calls
  @tool_calls
end