pub struct AskConfig {
pub provider: ProviderKind,
pub api_key: Option<String>,
pub model: String,
pub max_tokens: u32,
pub cache_ttl: CacheTtl,
pub base_url: Option<String>,
}Expand description
Knobs for an ask() call. Construct directly, or via
AskConfig::from_env to pull defaults from the environment.
Fields§
§provider: ProviderKind§api_key: Option<String>§model: String§max_tokens: u32§cache_ttl: CacheTtl§base_url: Option<String>Override the API base URL. Production callers leave this
None; tests point it at a localhost mock.
Implementations§
Source§impl AskConfig
impl AskConfig
Sourcepub fn from_env() -> Result<AskConfig, AskError>
pub fn from_env() -> Result<AskConfig, AskError>
Build a config from environment variables, with built-in defaults for anything not set.
Recognized vars:
SQLRITE_LLM_PROVIDER—anthropic(only currently supported)SQLRITE_LLM_API_KEY— required at call time, but a missing var is not an error here (lets you build a config to inspect without the secret loaded)SQLRITE_LLM_MODEL— overridesDEFAULT_MODELSQLRITE_LLM_MAX_TOKENS— overridesDEFAULT_MAX_TOKENSSQLRITE_LLM_CACHE_TTL—5m(default) |1h|off
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AskConfig
impl RefUnwindSafe for AskConfig
impl Send for AskConfig
impl Sync for AskConfig
impl Unpin for AskConfig
impl UnsafeUnpin for AskConfig
impl UnwindSafe for AskConfig
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