INNER CODE UNIT · Rust

get

Far-Beyond-Pulsar/Pulsar-Native · crates/agent-providers/agent_chat_core/src/lib.rs:28

    pub fn get(&self, key: &str) -> Option<&str> {
        self.values.get(key).map(|s| s.as_str())
    }
    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>,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…