pub struct Request { /* private fields */ }Expand description
The complete owned input to one model call.
Its fields are immutable from the public API; provider adapters receive an owned value and must map local tools and hosted extensions through their distinct lanes.
Implementations§
Source§impl Request
impl Request
Sourcepub fn system_instruction(&self) -> &[Part]
pub fn system_instruction(&self) -> &[Part]
Returns ordered portable system content.
Sourcepub fn messages(&self) -> &[Item]
pub fn messages(&self) -> &[Item]
Returns the owned transcript projection.
Every item here is ModelVisibility::Visible and every tool exchange in it is
closed, because RequestPlan::try_into_request is the only way to build this
value and it applies both rules. A provider adapter maps what it is
given; it never has to decide what the model may see.
Sourcepub fn tools(&self) -> &[ClientTool]
pub fn tools(&self) -> &[ClientTool]
Returns only client-local tools.
Sourcepub const fn sampling(&self) -> &SamplingParams
pub const fn sampling(&self) -> &SamplingParams
Returns frozen sampling controls.
Sourcepub fn extensions(&self) -> &[Envelope]
pub fn extensions(&self) -> &[Envelope]
Returns only provider-hosted/model-native extensions.
Sourcepub fn ephemeral(&self) -> &[Part]
pub fn ephemeral(&self) -> &[Part]
Returns volatile tail content for this call.
Ephemeral content is a lane of its own: it is never an Item, never
enters the transcript, and never survives the Step that produced it. A
replay or equivalence check drawn over the transcript, or over
Request::messages, therefore already excludes it and needs no
separate switch to say so.