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
The complete arguments JSON string.
-
#call_id ⇒ Object
readonly
The call identifier for response matching.
-
#item_id ⇒ Object
readonly
The tool call item identifier.
-
#name ⇒ Object
readonly
The tool name.
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 ⇒ Object
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.
- item_id
-
String - the tool call item identifier
- call_id
-
String - the call identifier for response matching
- name
-
String - the tool name
- arguments
-
String - the complete arguments JSON string
- role
-
Symbol - the message role (defaults to :assistant)
26 27 28 29 30 31 32 |
# File 'lib/riffer/stream_events/tool_call_done.rb', line 26 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)
The complete arguments JSON string.
17 18 19 |
# File 'lib/riffer/stream_events/tool_call_done.rb', line 17 def arguments @arguments end |
#call_id ⇒ Object (readonly)
The call identifier for response matching.
11 12 13 |
# File 'lib/riffer/stream_events/tool_call_done.rb', line 11 def call_id @call_id end |
#item_id ⇒ Object (readonly)
The tool call item identifier.
8 9 10 |
# File 'lib/riffer/stream_events/tool_call_done.rb', line 8 def item_id @item_id end |
#name ⇒ Object (readonly)
The tool name.
14 15 16 |
# File 'lib/riffer/stream_events/tool_call_done.rb', line 14 def name @name end |
Instance Method Details
#to_h ⇒ Object
Converts the event to a hash.
Returns Hash - the event data.
37 38 39 |
# File 'lib/riffer/stream_events/tool_call_done.rb', line 37 def to_h {role: @role, item_id: @item_id, call_id: @call_id, name: @name, arguments: @arguments} end |