Exceptions
Exceptions
any_llm.exceptions
Custom exceptions for any-llm package.
MissingApiKeyError
Bases: Exception
Exception raised when an API key is missing or not provided.
Source code in src/any_llm/exceptions.py
__init__(provider_name, env_var_name)
Initialize the exception.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
provider_name
|
str
|
Name of the provider (e.g., "OpenAI", "Google", "Mistral") |
required |
env_var_name
|
str
|
Name of the environment variable that should contain the API key |
required |
Source code in src/any_llm/exceptions.py
UnsupportedParameterError
Bases: Exception
Exception raised when an unsupported parameter is provided.
Source code in src/any_llm/exceptions.py
__init__(parameter_name, provider_name)
Initialize the exception.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameter_name
|
str
|
Name of the parameter that was provided |
required |
Source code in src/any_llm/exceptions.py
UnsupportedProviderError
Bases: Exception
Exception raised when an unsupported provider is requested.
Source code in src/any_llm/exceptions.py
__init__(provider_key, supported_providers)
Initialize the exception.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
provider_key
|
str
|
The provider key that was requested |
required |
supported_providers
|
list[str]
|
List of supported provider keys |
required |