#[non_exhaustive]pub struct ModelRequest {
pub invocation_id: InvocationId,
pub frame: ContextFrame,
pub model: ModelRef,
pub generation: GenerationOptions,
pub cache: CacheDirective,
}Expand description
Everything one logical invocation needs. All fields stay unchanged across internal retries; the gateway owns any attempt numbering and retry policy.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.invocation_id: InvocationIdIdentifies the turn + round this logical invocation belongs to; the same id recurs on every retry.
frame: ContextFrameThe ContextFrame the gateway renders for the invocation.
model: ModelRefWhich model to invoke.
generation: GenerationOptionsThe GenerationOptions governing sampling.
cache: CacheDirectiveThe prompt-cache instruction the translation face renders. Invariant across retries like the rest of the request.
Implementations§
Source§impl ModelRequest
impl ModelRequest
Sourcepub fn new(
invocation_id: InvocationId,
frame: ContextFrame,
model: ModelRef,
) -> Self
pub fn new( invocation_id: InvocationId, frame: ContextFrame, model: ModelRef, ) -> Self
A request with default generation options and no cache directive. The
tools offered are the frame’s crate::ToolChange blocks.
Trait Implementations§
Source§impl Clone for ModelRequest
impl Clone for ModelRequest
Auto Trait Implementations§
impl Forget for ModelRequest
impl Freeze for ModelRequest
impl Move 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
Mutably borrows from an owned value. Read more