pub struct ModelRequest {
pub model: String,
pub instructions: Option<String>,
pub messages: Vec<ModelMessage>,
pub thinking: ThinkingConfig,
pub tools: Vec<ToolDefinition>,
pub session_id: Option<String>,
}Expand description
A request to a model provider containing the conversation, model name, thinking configuration, and available tool definitions.
Fields§
§model: StringThe model identifier to use (e.g. "gpt-5.5", "claude-sonnet-4-20250514").
instructions: Option<String>Stable base instructions sent in the provider’s instructions field
(Responses API) or as the first system message (Chat Completions,
Anthropic, Gemini). Kept separate from Self::messages so that
dynamic context blocks (developer messages) don’t invalidate the
provider’s prompt cache for this prefix.
messages: Vec<ModelMessage>The conversation messages to send to the model.
thinking: ThinkingConfigThe thinking/reasoning effort level to request.
tools: Vec<ToolDefinition>Tool definitions the model may invoke.
session_id: Option<String>Stable session id for provider-side prompt-cache affinity.
Providers such as Charm Hyper use this to set x-session-id and
x-session-affinity so consecutive turns of the same agent session
hit the same KV-cache shard. Not serialized to disk/transcripts.
Trait Implementations§
Source§impl Clone for ModelRequest
impl Clone for ModelRequest
Source§fn clone(&self) -> ModelRequest
fn clone(&self) -> ModelRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more