Class: Durable::Llm::Providers::Google::GoogleStreamResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/durable/llm/providers/google.rb

Overview

Response object for streaming Google Generative AI chunks.

Wraps individual chunks from the streaming response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parsed) ⇒ GoogleStreamResponse

Returns a new instance of GoogleStreamResponse.



269
270
271
# File 'lib/durable/llm/providers/google.rb', line 269

def initialize(parsed)
  @choices = [GoogleStreamChoice.new(parsed)]
end

Instance Attribute Details

#choicesObject (readonly)

Returns the value of attribute choices.



267
268
269
# File 'lib/durable/llm/providers/google.rb', line 267

def choices
  @choices
end

Instance Method Details

#to_sObject



273
274
275
# File 'lib/durable/llm/providers/google.rb', line 273

def to_s
  @choices.map(&:to_s).join
end