Class: Riffer::StreamEvents::TextDelta
- Defined in:
- lib/riffer/stream_events/text_delta.rb
Overview
Represents an incremental text chunk during streaming.
Emitted when the LLM produces text content incrementally.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
The incremental text content.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(content, role: :assistant) ⇒ TextDelta
constructor
– : (String, ?role: Symbol) -> void.
-
#to_h ⇒ Object
– : () -> Hash[Symbol, untyped].
Constructor Details
#initialize(content, role: :assistant) ⇒ TextDelta
– : (String, ?role: Symbol) -> void
13 14 15 16 |
# File 'lib/riffer/stream_events/text_delta.rb', line 13 def initialize(content, role: :assistant) super(role: role) @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
The incremental text content.
9 10 11 |
# File 'lib/riffer/stream_events/text_delta.rb', line 9 def content @content end |
Instance Method Details
#to_h ⇒ Object
– : () -> Hash[Symbol, untyped]
20 21 22 |
# File 'lib/riffer/stream_events/text_delta.rb', line 20 def to_h {role: @role, content: @content} end |