Class: Durable::Llm::Providers::Google::GoogleStreamChoice

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#deltaObject (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_sObject



288
289
290
# File 'lib/durable/llm/providers/google.rb', line 288

def to_s
  @delta.to_s
end