Class: Durable::Llm::Providers::Google::GoogleResponse
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Google::GoogleResponse
- Defined in:
- lib/durable/llm/providers/google.rb
Overview
Response object for Google Generative AI API responses.
Wraps the raw response and provides a consistent interface for accessing candidate content and metadata.
Instance Attribute Summary collapse
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
Instance Method Summary collapse
- #choices ⇒ Object
-
#initialize(response) ⇒ GoogleResponse
constructor
A new instance of GoogleResponse.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ GoogleResponse
Returns a new instance of GoogleResponse.
220 221 222 |
# File 'lib/durable/llm/providers/google.rb', line 220 def initialize(response) @raw_response = response end |
Instance Attribute Details
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
218 219 220 |
# File 'lib/durable/llm/providers/google.rb', line 218 def raw_response @raw_response end |
Instance Method Details
#choices ⇒ Object
224 225 226 |
# File 'lib/durable/llm/providers/google.rb', line 224 def choices [GoogleChoice.new(@raw_response['candidates']&.first)] end |
#to_s ⇒ Object
228 229 230 |
# File 'lib/durable/llm/providers/google.rb', line 228 def to_s choices.map(&:to_s).join(' ') end |