Class: RailsAgents::Message
- Inherits:
-
Data
- Object
- Data
- RailsAgents::Message
- Defined in:
- lib/rails_agents/message.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#raw_content ⇒ Object
readonly
Returns the value of attribute raw_content.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#tool_call_id ⇒ Object
readonly
Returns the value of attribute tool_call_id.
-
#tool_calls ⇒ Object
readonly
Returns the value of attribute tool_calls.
Class Method Summary collapse
- .assistant(content, tool_calls: nil, raw_content: nil) ⇒ Object
- .system(content) ⇒ Object
- .tool(content, tool_call_id:) ⇒ Object
- .user(content) ⇒ Object
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content
4 5 6 |
# File 'lib/rails_agents/message.rb', line 4 def content @content end |
#raw_content ⇒ Object (readonly)
Returns the value of attribute raw_content
4 5 6 |
# File 'lib/rails_agents/message.rb', line 4 def raw_content @raw_content end |
#role ⇒ Object (readonly)
Returns the value of attribute role
4 5 6 |
# File 'lib/rails_agents/message.rb', line 4 def role @role end |
#tool_call_id ⇒ Object (readonly)
Returns the value of attribute tool_call_id
4 5 6 |
# File 'lib/rails_agents/message.rb', line 4 def tool_call_id @tool_call_id end |
#tool_calls ⇒ Object (readonly)
Returns the value of attribute tool_calls
4 5 6 |
# File 'lib/rails_agents/message.rb', line 4 def tool_calls @tool_calls end |
Class Method Details
.assistant(content, tool_calls: nil, raw_content: nil) ⇒ Object
7 8 9 |
# File 'lib/rails_agents/message.rb', line 7 def self.assistant(content, tool_calls: nil, raw_content: nil) new(role: :assistant, content:, tool_calls:, tool_call_id: nil, raw_content:) end |
.system(content) ⇒ Object
5 |
# File 'lib/rails_agents/message.rb', line 5 def self.system(content) = new(role: :system, content:, tool_calls: nil, tool_call_id: nil, raw_content: nil) |
.tool(content, tool_call_id:) ⇒ Object
10 |
# File 'lib/rails_agents/message.rb', line 10 def self.tool(content, tool_call_id:) = new(role: :tool, content:, tool_calls: nil, tool_call_id:, raw_content: nil) |
.user(content) ⇒ Object
6 |
# File 'lib/rails_agents/message.rb', line 6 def self.user(content) = new(role: :user, content:, tool_calls: nil, tool_call_id: nil, raw_content: nil) |