pub struct ChatRequest {
pub model_id: String,
pub messages: Vec<ChatMessage>,
pub system_prompt: String,
pub instructions: Option<String>,
pub reasoning: ReasoningLevel,
pub temperature: f32,
pub max_tokens: usize,
pub tools: Vec<ToolDefinition>,
pub ollama_num_ctx: Option<u32>,
pub ollama_allow_ram_offload: Option<bool>,
}Expand description
Inputs a model needs to generate a turn. Built by the reducer from
Session + Settings + current MERMAID.md context. Pure data —
no provider-specific knowledge here (that’s in
providers::model::*::chat).
Fields§
§model_id: String§messages: Vec<ChatMessage>§system_prompt: String§instructions: Option<String>MERMAID.md content to suffix onto the system prompt. None if
no file was loaded for this project.
reasoning: ReasoningLevel§temperature: f32§max_tokens: usize§tools: Vec<ToolDefinition>Tool definitions advertised to the model. Combination of the
built-in tool set + any advertised MCP tools from McpState.
ollama_num_ctx: Option<u32>Per-model Ollama num_ctx override (/context <n>/max), or None to
auto-fit. The one provider-specific knob that rides on the request, the
same way reasoning does — so a live /context change applies on the
next turn without rebuilding the cached provider. Ignored by non-Ollama
providers.
ollama_allow_ram_offload: Option<bool>Live Ollama RAM-offload toggle (/context offload on|off). Rides on the
request like ollama_num_ctx so a toggle applies on the next turn without
rebuilding the cached provider (whose config is frozen at startup).
None falls back to the persisted [ollama] allow_ram_offload. Ignored
by non-Ollama providers.
Trait Implementations§
Source§impl Clone for ChatRequest
impl Clone for ChatRequest
Source§fn clone(&self) -> ChatRequest
fn clone(&self) -> ChatRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ChatRequest
impl RefUnwindSafe for ChatRequest
impl Send for ChatRequest
impl Sync for ChatRequest
impl Unpin for ChatRequest
impl UnsafeUnpin for ChatRequest
impl UnwindSafe for ChatRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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