pub struct ChatConfig {
pub provider: Provider,
pub model: String,
pub deepseek_api_key: Option<String>,
pub deepseek_model: String,
pub params: GenerationParams,
pub context_tokens: usize,
pub context_size_mode: ContextSizeMode,
pub system_prompt_path: Option<PathBuf>,
pub request_timeout_secs: Option<u64>,
}Expand description
Chat / generation configuration.
Controls the chat model, provider, generation parameters, context window,
and overflow behaviour. Swappable at runtime via the /chat REPL command.
Fields§
§provider: ProviderChat backend: ollama (local) or deepseek (cloud API).
model: StringModel name for Ollama chat (ignored when provider is Deepseek).
deepseek_api_key: Option<String>DeepSeek API key (required when provider is Deepseek).
Can also be set via the DEEPSEEK_API_KEY env var.
deepseek_model: StringModel name for DeepSeek (ignored when provider is Ollama).
params: GenerationParamsSampling temperature, top_p, max_tokens, seed.
Each field is optional — when None the provider’s own default is used.
context_tokens: usizeContext window size of the current chat model (tokens). Used to calculate how much retrieved text fits in the prompt.
context_size_mode: ContextSizeModeControls context-overflow behaviour: Auto retries with fewer chunks,
Forced treats overflow as a fatal error.
system_prompt_path: Option<PathBuf>Path to a Markdown file containing a custom system prompt for the
chat agent. Use {context} as placeholder for retrieved documents.
request_timeout_secs: Option<u64>Per-request timeout in seconds for Ollama/DeepSeek network calls.
None means no timeout (default).
Implementations§
Source§impl ChatConfig
impl ChatConfig
Sourcepub fn override_with(&mut self, cli: &ChatConfig, defaults: &ChatConfig)
pub fn override_with(&mut self, cli: &ChatConfig, defaults: &ChatConfig)
Override fields where cli differs from defaults — used when
merging CLI arguments on top of a profile file.
Trait Implementations§
Source§impl Clone for ChatConfig
impl Clone for ChatConfig
Source§fn clone(&self) -> ChatConfig
fn clone(&self) -> ChatConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChatConfig
impl Debug for ChatConfig
Source§impl Default for ChatConfig
impl Default for ChatConfig
Source§impl<'de> Deserialize<'de> for ChatConfig
impl<'de> Deserialize<'de> for ChatConfig
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 ChatConfig
impl RefUnwindSafe for ChatConfig
impl Send for ChatConfig
impl Sync for ChatConfig
impl Unpin for ChatConfig
impl UnsafeUnpin for ChatConfig
impl UnwindSafe for ChatConfig
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> 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