Class: Durable::Llm::Providers::Mistral::MistralStreamDelta
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Mistral::MistralStreamDelta
- Defined in:
- lib/durable/llm/providers/mistral.rb
Overview
Represents a delta (incremental change) in streaming responses
Contains incremental content and role information for streaming completions.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#role ⇒ String?
readonly
The role for this delta, or nil if not present.
Instance Method Summary collapse
-
#initialize(delta) ⇒ MistralStreamDelta
constructor
Initializes a new stream delta object.
-
#to_s ⇒ String
Returns the content of the delta, or empty string if none.
Constructor Details
#initialize(delta) ⇒ MistralStreamDelta
Initializes a new stream delta object
414 415 416 417 |
# File 'lib/durable/llm/providers/mistral.rb', line 414 def initialize(delta) @role = delta['role'] @content = delta['content'] end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
409 |
# File 'lib/durable/llm/providers/mistral.rb', line 409 attr_reader :role, :content |
#role ⇒ String? (readonly)
Returns The role for this delta, or nil if not present.
409 410 411 |
# File 'lib/durable/llm/providers/mistral.rb', line 409 def role @role end |
Instance Method Details
#to_s ⇒ String
Returns the content of the delta, or empty string if none
422 423 424 |
# File 'lib/durable/llm/providers/mistral.rb', line 422 def to_s @content || '' end |