Class: Durable::Llm::Providers::DeepSeek::DeepSeekStreamChoice
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::DeepSeek::DeepSeekStreamChoice
- Defined in:
- lib/durable/llm/providers/deepseek.rb
Overview
Stream choice wrapper for DeepSeek streaming
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) ⇒ DeepSeekStreamChoice
constructor
A new instance of DeepSeekStreamChoice.
- #to_s ⇒ Object
Constructor Details
#initialize(choice) ⇒ DeepSeekStreamChoice
Returns a new instance of DeepSeekStreamChoice.
204 205 206 207 208 |
# File 'lib/durable/llm/providers/deepseek.rb', line 204 def initialize(choice) @choice = [choice].flatten.first @delta = DeepSeekStreamDelta.new(@choice['delta']) @finish_reason = @choice['finish_reason'] end |
Instance Attribute Details
#delta ⇒ Object (readonly)
Returns the value of attribute delta.
202 203 204 |
# File 'lib/durable/llm/providers/deepseek.rb', line 202 def delta @delta end |
#finish_reason ⇒ Object (readonly)
Returns the value of attribute finish_reason.
202 203 204 |
# File 'lib/durable/llm/providers/deepseek.rb', line 202 def finish_reason @finish_reason end |
Instance Method Details
#to_s ⇒ Object
210 211 212 |
# File 'lib/durable/llm/providers/deepseek.rb', line 210 def to_s @delta.to_s end |