Class: Durable::Llm::Providers::Opencode::OpencodeStreamChoice
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Opencode::OpencodeStreamChoice
- Defined in:
- lib/durable/llm/providers/opencode.rb
Overview
Stream choice class for OpenCode API
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) ⇒ OpencodeStreamChoice
constructor
A new instance of OpencodeStreamChoice.
- #to_s ⇒ Object
Constructor Details
#initialize(choice) ⇒ OpencodeStreamChoice
Returns a new instance of OpencodeStreamChoice.
224 225 226 227 228 |
# File 'lib/durable/llm/providers/opencode.rb', line 224 def initialize(choice) @choice = [choice].flatten.first @delta = OpencodeStreamDelta.new(@choice['delta']) @finish_reason = @choice['finish_reason'] end |
Instance Attribute Details
#delta ⇒ Object (readonly)
Returns the value of attribute delta.
222 223 224 |
# File 'lib/durable/llm/providers/opencode.rb', line 222 def delta @delta end |
#finish_reason ⇒ Object (readonly)
Returns the value of attribute finish_reason.
222 223 224 |
# File 'lib/durable/llm/providers/opencode.rb', line 222 def finish_reason @finish_reason end |
Instance Method Details
#to_s ⇒ Object
230 231 232 |
# File 'lib/durable/llm/providers/opencode.rb', line 230 def to_s @delta.to_s end |