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

– : (String, ?role: Symbol) -> void



14
15
16
17
# File 'lib/riffer/stream_events/reasoning_done.rb', line 14

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

Instance Attribute Details

#contentObject (readonly)

The complete reasoning content.



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

def content
  @content
end

Instance Method Details

#to_hObject

– : () -> Hash[Symbol, untyped]



21
22
23
# File 'lib/riffer/stream_events/reasoning_done.rb', line 21

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