Class: AgUiProtocol::Core::Events::ThinkingTextMessageContentEvent

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

Overview

Event indicating a piece of a thinking text message.

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(delta:, timestamp: nil, raw_event: nil) ⇒ ThinkingTextMessageContentEvent

Returns a new instance of ThinkingTextMessageContentEvent.

Raises:

  • (ArgumentError)


303
304
305
306
307
308
# File 'lib/ag_ui_protocol/core/events.rb', line 303

def initialize(delta:, timestamp: nil, raw_event: nil)
  raise ArgumentError, "delta must be non-empty" if delta.nil? || delta.empty?

  super(type: EventType::THINKING_TEXT_MESSAGE_CONTENT, timestamp: timestamp, raw_event: raw_event)
  @delta = delta
end

Instance Attribute Details

#deltaObject (readonly)

Returns the value of attribute delta.



297
298
299
# File 'lib/ag_ui_protocol/core/events.rb', line 297

def delta
  @delta
end

Instance Method Details

#to_hObject



311
312
313
# File 'lib/ag_ui_protocol/core/events.rb', line 311

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