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.
7 8 9 10 |
# File 'lib/riffer/messages/assistant.rb', line 7 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.
5 6 7 |
# File 'lib/riffer/messages/assistant.rb', line 5 def tool_calls @tool_calls end |
Instance Method Details
#role ⇒ Object
12 13 14 |
# File 'lib/riffer/messages/assistant.rb', line 12 def role "assistant" end |
#to_h ⇒ Object
16 17 18 19 20 |
# File 'lib/riffer/messages/assistant.rb', line 16 def to_h hash = {role: role, content: content} hash[:tool_calls] = tool_calls unless tool_calls.empty? hash end |