INNER CODE UNIT · Rust
require
Far-Beyond-Pulsar/Pulsar-Native · crates/agent-providers/agent_chat_core/src/lib.rs:31
pub fn require(&self, key: &str) -> anyhow::Result<&str> {
self.values
.get(key)
.map(|s| s.as_str())
.ok_or_else(|| anyhow::anyhow!("missing required config field: {key}"))
}
}
#[derive(Clone, Debug)]
pub struct ProviderEntry {
pub id: &'static str,
pub display_name: &'static str,
pub kind: ProviderKind,
pub default_endpoint: Option<&'static str>,
pub config_fields: Vec<ConfigField>,
}
pub trait ProviderCrate: Send + Sync {