Class: Riffer::StreamEvents::ToolCallDone

Inherits:
Base
  • Object
show all
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

Attributes inherited from Base

#role

Instance Method Summary collapse

Constructor Details

#initialize(item_id:, call_id:, name:, arguments:, role: :assistant) ⇒ ToolCallDone

– : (item_id: String, call_id: String, name: String, arguments: String, ?role: Symbol) -> void



22
23
24
25
26
27
28
# File 'lib/riffer/stream_events/tool_call_done.rb', line 22

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

#argumentsObject (readonly)

The complete arguments JSON string.



18
19
20
# File 'lib/riffer/stream_events/tool_call_done.rb', line 18

def arguments
  @arguments
end

#call_idObject (readonly)

The call identifier for response matching.



12
13
14
# File 'lib/riffer/stream_events/tool_call_done.rb', line 12

def call_id
  @call_id
end

#item_idObject (readonly)

The tool call item identifier.



9
10
11
# File 'lib/riffer/stream_events/tool_call_done.rb', line 9

def item_id
  @item_id
end

#nameObject (readonly)

The tool name.



15
16
17
# File 'lib/riffer/stream_events/tool_call_done.rb', line 15

def name
  @name
end

Instance Method Details

#to_hObject

– : () -> Hash[Symbol, untyped]



32
33
34
# File 'lib/riffer/stream_events/tool_call_done.rb', line 32

def to_h
  {role: @role, item_id: @item_id, call_id: @call_id, name: @name, arguments: @arguments}
end