Class: Durable::Llm::Providers::Google::GoogleChoice

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

Overview

Represents a single candidate choice in a Google response.

Contains the message content from the candidate.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(candidate) ⇒ GoogleChoice

Returns a new instance of GoogleChoice.



239
240
241
# File 'lib/durable/llm/providers/google.rb', line 239

def initialize(candidate)
  @message = GoogleMessage.new(candidate&.dig('content', 'parts')&.first)
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



237
238
239
# File 'lib/durable/llm/providers/google.rb', line 237

def message
  @message
end

Instance Method Details

#to_sObject



243
244
245
# File 'lib/durable/llm/providers/google.rb', line 243

def to_s
  @message.to_s
end