Exception: ActiveGenie::InvalidProviderError
- Inherits:
-
StandardError
- Object
- StandardError
- ActiveGenie::InvalidProviderError
- Defined in:
- lib/active_genie/errors/invalid_provider_error.rb
Constant Summary collapse
- TEXT =
<<~TEXT Invalid provider: %<provider>s To configure ActiveGenie, you can either: 1. Set up global configuration: ```ruby ActiveGenie.configure do |config| config.providers.default = 'openai' config.providers.openai.api_key = 'your_api_key' # ... other configuration options end ``` 2. Or pass configuration directly to the method call: ```ruby ActiveGenie::Extraction.call( arg1, arg2, config: { providers: { default: 'openai', openai: { api_key: 'your_api_key' } } } ) ``` Available providers: %<available_providers>s TEXT
Instance Method Summary collapse
- #available_providers ⇒ Object
-
#initialize(provider) ⇒ InvalidProviderError
constructor
A new instance of InvalidProviderError.
Constructor Details
#initialize(provider) ⇒ InvalidProviderError
Returns a new instance of InvalidProviderError.
37 38 39 |
# File 'lib/active_genie/errors/invalid_provider_error.rb', line 37 def initialize(provider) super(format(TEXT, provider:, available_providers:)) end |
Instance Method Details
#available_providers ⇒ Object
41 42 43 |
# File 'lib/active_genie/errors/invalid_provider_error.rb', line 41 def available_providers ActiveGenie.configuration.providers.valid.keys.join(', ') end |