Class: Durable::Llm::Providers::Google::GoogleStreamChoice
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Google::GoogleStreamChoice
- Defined in:
- lib/durable/llm/providers/google.rb
Overview
Represents a single choice in a streaming Google response chunk.
Contains the delta (incremental content) for the choice.
Instance Attribute Summary collapse
-
#delta ⇒ Object
readonly
Returns the value of attribute delta.
Instance Method Summary collapse
-
#initialize(parsed) ⇒ GoogleStreamChoice
constructor
A new instance of GoogleStreamChoice.
- #to_s ⇒ Object
Constructor Details
#initialize(parsed) ⇒ GoogleStreamChoice
Returns a new instance of GoogleStreamChoice.
284 285 286 |
# File 'lib/durable/llm/providers/google.rb', line 284 def initialize(parsed) @delta = GoogleStreamDelta.new(parsed.dig('candidates', 0, 'content', 'parts', 0)) end |
Instance Attribute Details
#delta ⇒ Object (readonly)
Returns the value of attribute delta.
282 283 284 |
# File 'lib/durable/llm/providers/google.rb', line 282 def delta @delta end |
Instance Method Details
#to_s ⇒ Object
288 289 290 |
# File 'lib/durable/llm/providers/google.rb', line 288 def to_s @delta.to_s end |