Class: Google::Genai::Types::GenerateContentResponse
- Defined in:
- lib/google/genai/types.rb
Instance Attribute Summary collapse
-
#candidates ⇒ Object
Returns the value of attribute candidates.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ GenerateContentResponse
constructor
A new instance of GenerateContentResponse.
- #text ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ GenerateContentResponse
Returns a new instance of GenerateContentResponse.
63 64 65 66 |
# File 'lib/google/genai/types.rb', line 63 def initialize(attributes = {}) super self.candidates = Array(self.candidates).map { |c| c.is_a?(Candidate) ? c : Candidate.new(c) } end |
Instance Attribute Details
#candidates ⇒ Object
Returns the value of attribute candidates.
61 62 63 |
# File 'lib/google/genai/types.rb', line 61 def candidates @candidates end |
Instance Method Details
#text ⇒ Object
68 69 70 |
# File 'lib/google/genai/types.rb', line 68 def text candidates&.first&.content&.parts&.map(&:text)&.join end |