pub struct ModelRequest {
pub model: String,
pub system: Option<String>,
pub messages: Vec<ChatMessage>,
pub max_tokens: u32,
pub tools: Value,
pub raw: Value,
pub cache_prefix: bool,
}Expand description
A provider-agnostic model request, built once per incoming call and re-used (with
model swapped) across every rung of the ladder.
Fields§
§model: Stringprovider/model, e.g. "anthropic/claude-haiku-4-5".
system: Option<String>System prompt, if any.
messages: Vec<ChatMessage>Conversation turns.
max_tokens: u32Max tokens to generate.
tools: ValueOpaque tool/function-calling passthrough, forwarded as-is to the wire provider.
raw: ValueThe full original inbound request JSON, when this request came off the proxy’s wire
(ADR 0005). Anthropic-dialect providers send it verbatim with only model swapped (and
stream stripped), so every field — tools, tool_choice, temperature, thinking,
stop_sequences, … — survives the rung exactly as the caller wrote it. Null for
synthesized requests (judge / consistency samples), which use the normalized fields.
cache_prefix: boolWhether to insert prompt-cache breakpoints on the stable prefix — see
add_cache_breakpoints. Set from [escalation] prompt_cache; false everywhere else,
including synthesized judge/consistency requests, so nothing changes unless asked.
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 moreSource§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