Class: AgUiProtocol::Core::Events::ToolCallStartEvent

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

Overview

Signals the start of a tool call.

“‘ruby

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

tool_call_id: "tc1",
tool_call_name: "search",
parent_message_id: nil

)

“‘

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:, tool_call_name:, parent_message_id: nil, timestamp: nil, raw_event: nil) ⇒ ToolCallStartEvent

Returns a new instance of ToolCallStartEvent.



362
363
364
365
366
367
# File 'lib/ag_ui_protocol/core/events.rb', line 362

def initialize(tool_call_id:, tool_call_name:, parent_message_id: nil, timestamp: nil, raw_event: nil)
  super(type: EventType::TOOL_CALL_START, timestamp: timestamp, raw_event: raw_event)
  @tool_call_id = tool_call_id
  @tool_call_name = tool_call_name
  @parent_message_id = parent_message_id
end

Instance Attribute Details

#parent_message_idObject (readonly)

Returns the value of attribute parent_message_id.



346
347
348
# File 'lib/ag_ui_protocol/core/events.rb', line 346

def parent_message_id
  @parent_message_id
end

#tool_call_idObject (readonly)

Returns the value of attribute tool_call_id.



340
341
342
# File 'lib/ag_ui_protocol/core/events.rb', line 340

def tool_call_id
  @tool_call_id
end

#tool_call_nameObject (readonly)

Returns the value of attribute tool_call_name.



343
344
345
# File 'lib/ag_ui_protocol/core/events.rb', line 343

def tool_call_name
  @tool_call_name
end

Instance Method Details

#to_hObject



370
371
372
# File 'lib/ag_ui_protocol/core/events.rb', line 370

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