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)


281
282
283
284
285
286
# File 'lib/ag_ui_protocol/core/events.rb', line 281

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.



275
276
277
# File 'lib/ag_ui_protocol/core/events.rb', line 275

def delta
  @delta
end

Instance Method Details

#to_hObject



289
290
291
# File 'lib/ag_ui_protocol/core/events.rb', line 289

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