Class: Riffer::StreamEvents::ToolCallDone
- Defined in:
- lib/riffer/stream_events/tool_call_done.rb
Overview
Riffer::StreamEvents::ToolCallDone represents a completed tool call during streaming.
Emitted when the LLM has finished building a tool call with complete arguments.
Instance Attribute Summary collapse
- #arguments ⇒ Object readonly
- #call_id ⇒ Object readonly
- #item_id ⇒ Object readonly
- #name ⇒ Object readonly
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(item_id:, call_id:, name:, arguments:, role: "assistant") ⇒ ToolCallDone
constructor
Creates a new tool call done event.
-
#to_h ⇒ Hash
Converts the event to a hash.
Constructor Details
#initialize(item_id:, call_id:, name:, arguments:, role: "assistant") ⇒ ToolCallDone
Creates a new tool call done event
17 18 19 20 21 22 23 |
# File 'lib/riffer/stream_events/tool_call_done.rb', line 17 def initialize(item_id:, call_id:, name:, arguments:, role: "assistant") super(role: role) @item_id = item_id @call_id = call_id @name = name @arguments = arguments end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
9 10 11 |
# File 'lib/riffer/stream_events/tool_call_done.rb', line 9 def arguments @arguments end |
#call_id ⇒ Object (readonly)
9 10 11 |
# File 'lib/riffer/stream_events/tool_call_done.rb', line 9 def call_id @call_id end |
#item_id ⇒ Object (readonly)
9 10 11 |
# File 'lib/riffer/stream_events/tool_call_done.rb', line 9 def item_id @item_id end |
#name ⇒ Object (readonly)
9 10 11 |
# File 'lib/riffer/stream_events/tool_call_done.rb', line 9 def name @name end |
Instance Method Details
#to_h ⇒ Hash
Converts the event to a hash
27 28 29 |
# File 'lib/riffer/stream_events/tool_call_done.rb', line 27 def to_h {role: @role, item_id: @item_id, call_id: @call_id, name: @name, arguments: @arguments} end |