Class: Riffer::StreamEvents::ReasoningDelta

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

Overview

Represents an incremental reasoning chunk during streaming.

Emitted when the LLM produces reasoning/thinking content incrementally. 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) ⇒ ReasoningDelta

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



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

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

Instance Attribute Details

#contentObject (readonly)

The incremental reasoning content.



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

def content
  @content
end

Instance Method Details

#to_hObject

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



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

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