Class: Riffer::StreamEvents::ToolCallDelta
- Defined in:
- lib/riffer/stream_events/tool_call_delta.rb
Overview
Riffer::StreamEvents::ToolCallDelta represents an incremental tool call chunk during streaming.
Emitted when the LLM is building a tool call, containing partial argument data.
Instance Attribute Summary collapse
- #arguments_delta ⇒ Object readonly
- #item_id ⇒ Object readonly
- #name ⇒ Object readonly
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(item_id:, arguments_delta:, name: nil, role: "assistant") ⇒ ToolCallDelta
constructor
Creates a new tool call delta event.
-
#to_h ⇒ Hash
Converts the event to a hash.
Constructor Details
#initialize(item_id:, arguments_delta:, name: nil, role: "assistant") ⇒ ToolCallDelta
Creates a new tool call delta event
16 17 18 19 20 21 |
# File 'lib/riffer/stream_events/tool_call_delta.rb', line 16 def initialize(item_id:, arguments_delta:, name: nil, role: "assistant") super(role: role) @item_id = item_id @name = name @arguments_delta = arguments_delta end |
Instance Attribute Details
#arguments_delta ⇒ Object (readonly)
9 10 11 |
# File 'lib/riffer/stream_events/tool_call_delta.rb', line 9 def arguments_delta @arguments_delta end |
#item_id ⇒ Object (readonly)
9 10 11 |
# File 'lib/riffer/stream_events/tool_call_delta.rb', line 9 def item_id @item_id end |
#name ⇒ Object (readonly)
9 10 11 |
# File 'lib/riffer/stream_events/tool_call_delta.rb', line 9 def name @name end |
Instance Method Details
#to_h ⇒ Hash
Converts the event to a hash
25 26 27 |
# File 'lib/riffer/stream_events/tool_call_delta.rb', line 25 def to_h {role: @role, item_id: @item_id, name: @name, arguments_delta: @arguments_delta}.compact end |