pub struct CompletionRequest {
pub model: String,
pub system: Option<Arc<str>>,
pub messages: Vec<Message>,
pub tools: Vec<ToolSchema>,
pub tool_choice: ToolChoice,
pub sampling: SamplingParams,
pub hosted_capabilities: HostedCapabilities,
}Expand description
Input for a single generation request.
Fields§
§model: String§system: Option<Arc<str>>System prompt. Uses Arc<str> instead of String: the request is cloned in the
turn main loop (sent to the provider, fanned out with the LlmCallStarted event),
and deep-copying a long system prompt repeatedly is expensive; Arc reduces clone
to a reference-count bump.
messages: Vec<Message>§tools: Vec<ToolSchema>§tool_choice: ToolChoice§sampling: SamplingParams§hosted_capabilities: HostedCapabilitiesThe set of hosted capabilities the provider may use in this turn.
Determined once at session startup (see
Reused from the session marker when assembling each turn’s request. The provider adapter uses this to decide whether to advertise a hosted tool on the wire.
Trait Implementations§
Source§impl Clone for CompletionRequest
impl Clone for CompletionRequest
Source§fn clone(&self) -> CompletionRequest
fn clone(&self) -> CompletionRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompletionRequest
impl Debug for CompletionRequest
Source§impl<'de> Deserialize<'de> for CompletionRequest
impl<'de> Deserialize<'de> for CompletionRequest
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CompletionRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CompletionRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CompletionRequest
impl PartialEq for CompletionRequest
Source§fn eq(&self, other: &CompletionRequest) -> bool
fn eq(&self, other: &CompletionRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CompletionRequest
impl Serialize for CompletionRequest
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for CompletionRequest
Auto Trait Implementations§
impl Freeze for CompletionRequest
impl RefUnwindSafe for CompletionRequest
impl Send for CompletionRequest
impl Sync for CompletionRequest
impl Unpin for CompletionRequest
impl UnsafeUnpin for CompletionRequest
impl UnwindSafe for CompletionRequest
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