Class: Riffer::Messages::Assistant
- Defined in:
- lib/riffer/messages/assistant.rb
Instance Attribute Summary collapse
-
#tool_calls ⇒ Object
readonly
Returns the value of attribute tool_calls.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(content, tool_calls: []) ⇒ Assistant
constructor
A new instance of Assistant.
- #role ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(content, tool_calls: []) ⇒ Assistant
Returns a new instance of Assistant.
6 7 8 9 |
# File 'lib/riffer/messages/assistant.rb', line 6 def initialize(content, tool_calls: []) super(content) @tool_calls = tool_calls end |
Instance Attribute Details
#tool_calls ⇒ Object (readonly)
Returns the value of attribute tool_calls.
4 5 6 |
# File 'lib/riffer/messages/assistant.rb', line 4 def tool_calls @tool_calls end |
Instance Method Details
#role ⇒ Object
11 12 13 |
# File 'lib/riffer/messages/assistant.rb', line 11 def role "assistant" end |
#to_h ⇒ Object
15 16 17 18 19 |
# File 'lib/riffer/messages/assistant.rb', line 15 def to_h hash = {role: role, content: content} hash[:tool_calls] = tool_calls unless tool_calls.empty? hash end |