Class: Durable::Llm::Providers::Fireworks::FireworksStreamChoice
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Fireworks::FireworksStreamChoice
- Defined in:
- lib/durable/llm/providers/fireworks.rb
Overview
Represents a single choice in a streaming Fireworks response chunk.
Contains the delta (incremental content) and finish reason for the choice.
Instance Attribute Summary collapse
-
#delta ⇒ Object
readonly
Returns the value of attribute delta.
-
#finish_reason ⇒ Object
readonly
Returns the value of attribute finish_reason.
Instance Method Summary collapse
-
#initialize(choice) ⇒ FireworksStreamChoice
constructor
A new instance of FireworksStreamChoice.
- #to_s ⇒ Object
Constructor Details
#initialize(choice) ⇒ FireworksStreamChoice
Returns a new instance of FireworksStreamChoice.
273 274 275 276 277 |
# File 'lib/durable/llm/providers/fireworks.rb', line 273 def initialize(choice) @choice = [choice].flatten.first @delta = FireworksStreamDelta.new(@choice['delta']) @finish_reason = @choice['finish_reason'] end |
Instance Attribute Details
#delta ⇒ Object (readonly)
Returns the value of attribute delta.
271 272 273 |
# File 'lib/durable/llm/providers/fireworks.rb', line 271 def delta @delta end |
#finish_reason ⇒ Object (readonly)
Returns the value of attribute finish_reason.
271 272 273 |
# File 'lib/durable/llm/providers/fireworks.rb', line 271 def finish_reason @finish_reason end |
Instance Method Details
#to_s ⇒ Object
279 280 281 |
# File 'lib/durable/llm/providers/fireworks.rb', line 279 def to_s @delta.to_s end |