Module: GeminiAi
- Defined in:
- lib/gemini-ai.rb,
lib/gemini-ai/http.rb,
lib/gemini-ai/client.rb,
lib/gemini-ai/errors.rb,
lib/gemini-ai/version.rb,
lib/gemini-ai/http_headers.rb
Defined Under Namespace
Modules: Errors, HTTP, HTTPHeaders
Classes: Client, Configuration, ConfigurationError, Error, MiddlewareErrors
Constant Summary
collapse
- VERSION =
"0.1.1".freeze
Class Attribute Summary collapse
Class Method Summary
collapse
Class Method Details
75
76
77
|
# File 'lib/gemini-ai.rb', line 75
def self.configure
yield(configuration)
end
|
.parsed_response(response, join_val: " ") ⇒ Object
79
80
81
82
83
84
85
|
# File 'lib/gemini-ai.rb', line 79
def self.parsed_response(response, join_val: " ")
response.flat_map do |entry|
entry["candidates"].map do |candidate|
candidate.dig("content", "parts").map { |part| part["text"] }.join(join_val)
end
end.join(join_val)
end
|