Class: Durable::Llm::Providers::Together::TogetherStreamChoice
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Together::TogetherStreamChoice
- Defined in:
- lib/durable/llm/providers/together.rb
Overview
Represents a choice in streaming responses.
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) ⇒ TogetherStreamChoice
constructor
Initializes a stream choice.
-
#to_s ⇒ String
Converts to string.
Constructor Details
#initialize(choice) ⇒ TogetherStreamChoice
Initializes a stream choice.
308 309 310 311 312 |
# File 'lib/durable/llm/providers/together.rb', line 308 def initialize(choice) @choice = [choice].flatten.first @delta = TogetherStreamDelta.new(@choice['delta']) @finish_reason = @choice['finish_reason'] end |
Instance Attribute Details
#delta ⇒ Object (readonly)
Returns the value of attribute delta.
303 304 305 |
# File 'lib/durable/llm/providers/together.rb', line 303 def delta @delta end |
#finish_reason ⇒ Object (readonly)
Returns the value of attribute finish_reason.
303 304 305 |
# File 'lib/durable/llm/providers/together.rb', line 303 def finish_reason @finish_reason end |
Instance Method Details
#to_s ⇒ String
Converts to string.
317 318 319 |
# File 'lib/durable/llm/providers/together.rb', line 317 def to_s @delta.to_s end |