pub struct Config {
pub llm: Vec<LlmConfig>,
}Expand description
The whole configuration tree, rooted at the file.
llm is an array of tables ([[llm]]), not a single [llm] section,
and it is that shape from the day drep init first wrote one - a phase
before failover could read it, precisely so the file format would not have
to change underneath a file drep itself wrote. The list is a preference
order: Self::providers is the failover chain.
#[serde(default)] means a file with an empty body deserializes
successfully; [validate] is what then rejects it, because a config
declaring no provider cannot run the mandatory LLM layer.
Fields§
§llm: Vec<LlmConfig>Implementations§
Source§impl Config
impl Config
Sourcepub fn providers(&self) -> Vec<&LlmConfig>
pub fn providers(&self) -> Vec<&LlmConfig>
The failover chain: every enabled provider, in file order.
The single definition of “which providers are in play”. enabled is
an opt-out, so a disabled entry is skipped wherever it sits - a
disabled head falls through to the entry below it rather than
producing NotConfigured, which is what parking the local model was
always meant to do.
A Vec rather than an iterator because every caller wants a length or
an index (the chain numbers its providers in error messages) and the
list is at most a handful of entries.