pub struct AiConfig {
pub provider: String,
pub model: String,
pub api_key_env: String,
pub cache: bool,
pub max_cost_run: f64,
pub max_tokens: i64,
pub timeout: i64,
pub base_url: String,
}Expand description
[ai] — defaults for the ai builtin (src/extensions/ai.rs).
Every field here is a DEFAULT: each one has a per-call flag that
overrides it (-P, -m, -t, -o, -n), so the table only
decides what an unadorned ai "..." does. The API key itself is
never stored here — api_key_env names the environment variable to
read, so a config file is safe to commit and safe to cat.
[ai]
provider = "anthropic"
model = "claude-opus-5"
api_key_env = "ANTHROPIC_API_KEY"
cache = true
max_cost_run = 5.0
max_tokens = 4096
timeout = 120Fields§
§provider: Stringanthropic (default), openai, openai_compat / compat /
local, ollama, or gemini / google.
model: StringModel id passed straight through to the provider.
api_key_env: StringName of the environment variable holding the API key. Only the NAME lives in config; the key is read from the environment.
cache: boolIn-process response cache, keyed on provider+model+system+prompt.
max_cost_run: f64Hard ceiling in USD on what one shell process may spend. 0
disables the ceiling. Refusal is an error, not a prompt.
max_tokens: i64Default max_tokens for a completion.
timeout: i64Default per-request timeout, in seconds.
base_url: StringBase URL for the openai_compat / local and ollama
providers. Empty means “use the provider’s own default”
($STRYKE_AI_BASE_URL-equivalent $ZSHRS_AI_BASE_URL, then
http://localhost:1234/v1/chat/completions; $OLLAMA_HOST,
then http://localhost:11434).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AiConfig
impl<'de> Deserialize<'de> for AiConfig
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>,
Auto Trait Implementations§
impl Freeze for AiConfig
impl RefUnwindSafe for AiConfig
impl Send for AiConfig
impl Sync for AiConfig
impl Unpin for AiConfig
impl UnsafeUnpin for AiConfig
impl UnwindSafe for AiConfig
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more