Class: Riffer::StreamEvents::ReasoningDone
- 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
-
#content ⇒ Object
readonly
The complete reasoning content.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(content, role: :assistant) ⇒ ReasoningDone
constructor
Creates a new reasoning done event.
-
#to_h ⇒ Object
Converts the event to a hash.
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
#content ⇒ Object (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_h ⇒ Object
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 |