Class: AgUiProtocol::Core::Events::ToolCallArgsEvent

Inherits:
BaseEvent show all
Defined in:
lib/ag_ui_protocol/core/events.rb

Overview

Represents a chunk of argument data for a tool call.

“‘ruby

event = AgUiProtocol::Core::Events::ToolCallArgsEvent.new(

tool_call_id: "tc1",
delta: "{\"q\":\"AG-UI\"}"

)

“‘

Instance Attribute Summary collapse

Attributes inherited from BaseEvent

#raw_event, #timestamp, #type

Instance Method Summary collapse

Methods inherited from Types::Model

#as_json, #to_json

Constructor Details

#initialize(tool_call_id:, delta:, timestamp: nil, raw_event: nil) ⇒ ToolCallArgsEvent

Returns a new instance of ToolCallArgsEvent.



398
399
400
401
402
# File 'lib/ag_ui_protocol/core/events.rb', line 398

def initialize(tool_call_id:, delta:, timestamp: nil, raw_event: nil)
  super(type: EventType::TOOL_CALL_ARGS, timestamp: timestamp, raw_event: raw_event)
  @tool_call_id = tool_call_id
  @delta = delta
end

Instance Attribute Details

#deltaObject (readonly)

Returns the value of attribute delta.



391
392
393
# File 'lib/ag_ui_protocol/core/events.rb', line 391

def delta
  @delta
end

#tool_call_idObject (readonly)

Returns the value of attribute tool_call_id.



388
389
390
# File 'lib/ag_ui_protocol/core/events.rb', line 388

def tool_call_id
  @tool_call_id
end

Instance Method Details

#to_hObject



405
406
407
# File 'lib/ag_ui_protocol/core/events.rb', line 405

def to_h
  super.merge(tool_call_id: @tool_call_id, delta: @delta)
end