Jido.AI.Provider (Jido AI v0.5.2)
View SourceSummary
Functions
Returns the base directory path for provider-specific files.
Ensures the given value is an atom.
Gets an adapter module by provider ID.
Retrieves combined information for a model across all providers.
Gets a specific model from a provider by its ID or name.
Lists all cached models across all providers.
Standardizes a model name across providers by removing version numbers and dates. This helps match equivalent models from different providers.
Types
@type provider_id() :: atom()
@type provider_type() :: :direct | :proxy
@type t() :: %Jido.AI.Provider{ api_base_url: String.t() | nil, description: String.t() | nil, endpoints: map(), id: atom(), models: list(), name: String.t(), proxy_for: [String.t()] | nil, requires_api_key: boolean(), type: provider_type() }
An AI model provider
Functions
Returns the base directory path for provider-specific files.
This is where provider configuration, models, and other data files are stored.
The path is relative to the project root and expands to ./priv/provider/
.
Ensures the given value is an atom.
Gets an adapter module by provider ID.
This is a helper function for getting the adapter module directly by ID.
Retrieves combined information for a model across all providers.
Parameters
- model_name: The name of the model to search for
Returns
- - Combined model information
- - Error if model not found
Gets a specific model from a provider by its ID or name.
Parameters
provider
- The provider struct or IDmodel
- The ID or name of the model to fetchopts
- Additional options for the request
Returns
{:ok, model}
- The model was found{:error, reason}
- The model was not found or an error occurred
Lists all cached models across all providers.
Returns
- List of model maps, each containing provider information
Standardizes a model name across providers by removing version numbers and dates. This helps match equivalent models from different providers.
Examples
iex> standardize_model_name("claude-3.7-sonnet-20250219")
"claude-3.7-sonnet"
iex> standardize_model_name("gpt-4-0613")
"gpt-4"