pub struct ProvidersConfig {
pub providers: Vec<ProviderConfig>,
pub replay: Vec<ReplayProviderConfig>,
pub credentials: IndexMap<String, ProviderCredentialConfig>,
pub prices: Prices,
}Expand description
A providers file: either {providers: [...]} or a bare list.
Fields§
§providers: Vec<ProviderConfig>§replay: Vec<ReplayProviderConfig>kind: replay entries (feature replay), built after providers so they
can wrap one of them.
credentials: IndexMap<String, ProviderCredentialConfig>Providers authenticated by a dynamic credential source (token broker, env var
read per request, or host-supplied), keyed by provider name. Entries replace
same-named providers. See docs/credentials.md.
prices: PricesTop level prices, also for providers this file does not configure, such
as the openai of OPENAI_API_KEY:
{provider: {model: {input_per_million, output_per_million}}}. They win
over the prices of an entry. A file may carry only prices (providers
empty), as a bundle’s file does for a host that configures the endpoints.
Implementations§
Source§impl ProvidersConfig
impl ProvidersConfig
Sourcepub fn load(
&self,
vars: &[(String, String)],
) -> Result<LoadedProviders, LlmError>
pub fn load( &self, vars: &[(String, String)], ) -> Result<LoadedProviders, LlmError>
Build the chat models (and the System One client of a typesafe
credentials entry), reading secrets and ${VAR} references from vars.
Providers files have no host app, so credentials entries cannot use
source: external or app_auth: external, and a credentials entry may not
share its name with a providers entry (it would silently replace its
aliases, model map and defaults).
Source§impl ProvidersConfig
impl ProvidersConfig
Sourcepub fn resolve_paths(&mut self, base: &Path)
pub fn resolve_paths(&mut self, base: &Path)
Resolve relative replay cassettes directories against base (usually
the directory of the providers file).