Class: RubyPi::LLM::Gemini
- Inherits:
-
BaseProvider
- Object
- BaseProvider
- RubyPi::LLM::Gemini
- Defined in:
- lib/ruby_pi/llm/gemini.rb
Overview
Google Gemini provider implementation. Communicates with the Gemini generativelanguage API to generate text completions, handle tool calls, and stream responses.
Constant Summary collapse
- BASE_URL =
Base URL for the Gemini generativelanguage API.
"https://generativelanguage.googleapis.com"- API_VERSION =
API version prefix for endpoint paths.
"v1beta"
Instance Attribute Summary
Attributes inherited from BaseProvider
#max_retries, #retry_base_delay, #retry_max_delay
Instance Method Summary collapse
-
#initialize(model: nil, api_key: nil, **options) ⇒ Gemini
constructor
Creates a new Gemini provider instance.
-
#model_name ⇒ String
Returns the Gemini model identifier.
-
#provider_name ⇒ Symbol
Returns :gemini as the provider identifier.
Methods inherited from BaseProvider
Constructor Details
#initialize(model: nil, api_key: nil, **options) ⇒ Gemini
Creates a new Gemini provider instance.
37 38 39 40 41 42 |
# File 'lib/ruby_pi/llm/gemini.rb', line 37 def initialize(model: nil, api_key: nil, **) super(**) config = @config @model = model || config.default_gemini_model @api_key = api_key || config.gemini_api_key end |
Instance Method Details
#model_name ⇒ String
Returns the Gemini model identifier.
47 48 49 |
# File 'lib/ruby_pi/llm/gemini.rb', line 47 def model_name @model end |
#provider_name ⇒ Symbol
Returns :gemini as the provider identifier.
54 55 56 |
# File 'lib/ruby_pi/llm/gemini.rb', line 54 def provider_name :gemini end |