Class: Riffer::StreamEvents::ReasoningDone

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

Overview

Represents completed reasoning during streaming; only emitted by providers that support reasoning (e.g. OpenAI with the 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



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

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

Instance Attribute Details

#contentObject (readonly)

The complete reasoning content.



8
9
10
# File 'lib/riffer/stream_events/reasoning_done.rb', line 8

def content
  @content
end

Instance Method Details

#to_hObject

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



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

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