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§impl Debug for ModelRequest
impl Debug for ModelRequest
Source§impl<'de> Deserialize<'de> for ModelRequest
impl<'de> Deserialize<'de> for ModelRequest
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 ModelRequest
impl RefUnwindSafe for ModelRequest
impl Send for ModelRequest
impl Sync for ModelRequest
impl Unpin for ModelRequest
impl UnsafeUnpin for ModelRequest
impl UnwindSafe for ModelRequest
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>,
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