Class: Riffer::StreamEvents::ReasoningDone

Inherits:
Base
  • Object
show all
Defined in:
lib/riffer/stream_events/reasoning_done.rb

Overview

Represents completion of reasoning during streaming.

Emitted when the LLM has finished producing reasoning/thinking content. Only available with providers that support reasoning (e.g., OpenAI with reasoning option).

Instance Attribute Summary collapse

Attributes inherited from Base

#role

Instance Method Summary collapse

Constructor Details

#initialize(content, role: :assistant) ⇒ ReasoningDone

Creates a new reasoning done event.

content

String - the complete reasoning content

role

Symbol - the message role (defaults to :assistant)



17
18
19
20
# File 'lib/riffer/stream_events/reasoning_done.rb', line 17

def initialize(content, role: :assistant)
  super(role: role)
  @content = content
end

Instance Attribute Details

#contentObject (readonly)

The complete reasoning content.

Returns String.



11
12
13
# File 'lib/riffer/stream_events/reasoning_done.rb', line 11

def content
  @content
end

Instance Method Details

#to_hObject

Converts the event to a hash.

Returns Hash with :role and :content keys.



25
26
27
# File 'lib/riffer/stream_events/reasoning_done.rb', line 25

def to_h
  {role: @role, content: @content}
end