Class: Riffer::StreamEvents::ToolCallDone

Inherits:
Base
  • Object
show all
Defined in:
lib/riffer/stream_events/tool_call_done.rb,
sig/generated/riffer/stream_events/tool_call_done.rbs

Overview

Represents a completed tool call during streaming.

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

Parameters:

  • item_id: (String)
  • call_id: (String)
  • name: (String)
  • arguments: (String)
  • role: (Symbol) (defaults to: :assistant)


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

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

#argumentsString (readonly)

The complete arguments JSON string.

Returns:

  • (String)


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

def arguments
  @arguments
end

#call_idString (readonly)

The call identifier for response matching.

Returns:

  • (String)


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

def call_id
  @call_id
end

#item_idString (readonly)

The tool call item identifier.

Returns:

  • (String)


7
8
9
# File 'lib/riffer/stream_events/tool_call_done.rb', line 7

def item_id
  @item_id
end

#nameString (readonly)

The tool name.

Returns:

  • (String)


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

def name
  @name
end

Instance Method Details

#to_hHash[Symbol, untyped]

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

Returns:

  • (Hash[Symbol, untyped])


30
31
32
# File 'lib/riffer/stream_events/tool_call_done.rb', line 30

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