Class: ActiveAgent::Providers::OpenAI::Options
- Inherits:
-
Common::BaseModel
- Object
- Common::BaseModel
- ActiveAgent::Providers::OpenAI::Options
- Defined in:
- lib/active_agent/providers/open_ai/options.rb
Direct Known Subclasses
ActiveAgent::Providers::Ollama::Options, ActiveAgent::Providers::OpenRouter::Options
Instance Method Summary collapse
- #extra_headers ⇒ Object
-
#initialize(kwargs = {}) ⇒ Options
constructor
Initialize from a hash (kwargs) with fallback to environment variables and OpenAI gem configuration.
Methods inherited from Common::BaseModel
#<=>, #==, attribute, #deep_compact, #deep_dup, delegate_attributes, drop_attributes, inherited, #inspect, keys, #merge!, required_attributes, #serialize, #to_h, #to_hash
Constructor Details
#initialize(kwargs = {}) ⇒ Options
Initialize from a hash (kwargs) with fallback to environment variables and OpenAI gem configuration
31 32 33 34 35 36 37 38 39 |
# File 'lib/active_agent/providers/open_ai/options.rb', line 31 def initialize(kwargs = {}) kwargs = kwargs.deep_symbolize_keys if kwargs.respond_to?(:deep_symbolize_keys) super(**deep_compact(kwargs.except(:default_url_options).merge( api_key: resolve_api_key(kwargs), organization_id: resolve_organization_id(kwargs), project_id: resolve_project_id(kwargs), ))) end |
Instance Method Details
#extra_headers ⇒ Object
41 42 43 |
# File 'lib/active_agent/providers/open_ai/options.rb', line 41 def extra_headers {} end |