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.
34 35 36 37 38 39 |
# File 'lib/ruby_pi/llm/gemini.rb', line 34 def initialize(model: nil, api_key: nil, **) super(**) config = RubyPi.configuration @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.
44 45 46 |
# File 'lib/ruby_pi/llm/gemini.rb', line 44 def model_name @model end |
#provider_name ⇒ Symbol
Returns :gemini as the provider identifier.
51 52 53 |
# File 'lib/ruby_pi/llm/gemini.rb', line 51 def provider_name :gemini end |