pub struct LlmConfig {
pub provider: String,
pub model: String,
pub api_key_env: Option<String>,
pub openai_url: Option<String>,
}Fields§
§provider: String“anthropic”, “openai”, “gemini”, or “ollama”
model: String§api_key_env: Option<String>API key env var name (e.g. “ANTHROPIC_API_KEY”)
openai_url: Option<String>Custom OpenAI-compatible API URL (e.g. for OpenRouter)
Implementations§
Source§impl LlmConfig
impl LlmConfig
Sourcepub fn to_backend_config(&self) -> BackendConfig
pub fn to_backend_config(&self) -> BackendConfig
Convert legacy LlmConfig (used by extract_llm, learn, capture/starter) into a BackendConfig that the new ChatBackend factory consumes. Mapping:
provider1:1, except: unknown providers WITH openai_url become “openai” (preserves the historical LlmConfig::llm_complete fall-through for OpenAI-compatible passthrough proxies).model1:1.api_key_env1:1 (factory’s resolve_api_key falls back to default_key_env(provider) when None — preserves LlmConfig behavior).openai_url→endpoint(semantic rename; same string semantics).timeout_secsalways None (factory defaults to 120s — matches the historical 60s reqwest default behavior closely enough).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LlmConfig
impl<'de> Deserialize<'de> for LlmConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LlmConfig
impl RefUnwindSafe for LlmConfig
impl Send for LlmConfig
impl Sync for LlmConfig
impl Unpin for LlmConfig
impl UnsafeUnpin for LlmConfig
impl UnwindSafe for LlmConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more