pub struct Config {
pub provider: ProviderConfig,
pub update: UpdateConfig,
/* private fields */
}Fields§
§provider: ProviderConfig§update: UpdateConfigImplementations§
Source§impl Config
impl Config
Sourcepub fn init_user_config(layout: &Layout) -> Result<PathBuf>
pub fn init_user_config(layout: &Layout) -> Result<PathBuf>
Write a starter config.toml into the instance unless it has one, and
return its path.
Source§impl Config
impl Config
Sourcepub fn load(
layout: &Layout,
workspace: &Path,
overrides: ConfigOverrides,
) -> Result<Self>
pub fn load( layout: &Layout, workspace: &Path, overrides: ConfigOverrides, ) -> Result<Self>
The configuration a session started in workspace of the instance at
layout runs with.
Sourcepub fn load_user(layout: &Layout, overrides: ConfigOverrides) -> Result<Self>
pub fn load_user(layout: &Layout, overrides: ConfigOverrides) -> Result<Self>
Load without a project layer, for settings that project configuration
can never set (such as [agents]), so the caller’s directory is irrelevant.
Sourcepub fn settings_with_origins(
layout: &Layout,
workspace: Option<&Path>,
overrides: &ConfigOverrides,
) -> Result<Vec<Setting>>
pub fn settings_with_origins( layout: &Layout, workspace: Option<&Path>, overrides: &ConfigOverrides, ) -> Result<Vec<Setting>>
Every leaf setting after layering, as a session started in
workspace would see it, with the layer that set it. Secret values are
replaced by <hidden>. Channel accounts are left out: scv config show reports them with their credentials.
Source§impl Config
impl Config
Sourcepub fn hosted_web_search(&self) -> bool
pub fn hosted_web_search(&self) -> bool
Whether to offer the provider’s hosted web search to tool-enabled sessions.
pub fn adapters(&self) -> HashMap<String, AgentAdapterConfig>
Sourcepub fn policy_mode(&self) -> PolicyMode
pub fn policy_mode(&self) -> PolicyMode
[policy] mode in effect.
Sourcepub fn agent_mode(&self, name: &str) -> PolicyMode
pub fn agent_mode(&self, name: &str) -> PolicyMode
The mode delegated agent name starts in: its own [agents.<name>] mode, else [policy] mode.
Sourcepub fn agent_modes(&self) -> Vec<(String, PolicyMode)>
pub fn agent_modes(&self) -> Vec<(String, PolicyMode)>
The agents with a mode of their own, and that mode.
Sourcepub fn publish_crate_versions_per_day(&self) -> u64
pub fn publish_crate_versions_per_day(&self) -> u64
[policy] publish_crate_versions_per_day: versions of one crate that
may reach crates.io in any 24 hours before publishing asks the owner.
Sourcepub fn deprecated(&self) -> &[Deprecated]
pub fn deprecated(&self) -> &[Deprecated]
The deprecated keys the layers set, each read as its replacement.
Sourcepub fn layout(&self) -> Layout
pub fn layout(&self) -> Layout
The paths under this instance’s home. It does not know whether the
instance is the default one, so take the service unit name from the
Layout the process resolved instead.