pub struct ApiRequest {
pub model: String,
pub messages: Vec<Value>,
pub system: Option<String>,
pub temperature: f64,
pub max_tokens: usize,
pub tools: Option<Vec<Value>>,
pub tool_choice: Option<String>,
pub parallel_tool_calls: Option<bool>,
pub stream: bool,
pub budget_tokens: usize,
pub cache_control: bool,
pub response_format: Option<ResponseFormat>,
}Expand description
Unified request parameters for any protocol.
Fields§
§model: String§messages: Vec<Value>§system: Option<String>§temperature: f64§max_tokens: usize§tools: Option<Vec<Value>>§tool_choice: Option<String>§parallel_tool_calls: Option<bool>§stream: bool§budget_tokens: usize§cache_control: boolWhen true, mark system prompt and tool definitions for Anthropic prompt caching. Enables cache reuse across parent/child agent calls sharing the same prefix.
response_format: Option<ResponseFormat>Optional schema constraint on the response. Each handler maps
this to its provider’s native field — see ResponseFormat.
Trait Implementations§
Source§impl Clone for ApiRequest
impl Clone for ApiRequest
Source§fn clone(&self) -> ApiRequest
fn clone(&self) -> ApiRequest
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 moreAuto Trait Implementations§
impl Freeze for ApiRequest
impl RefUnwindSafe for ApiRequest
impl Send for ApiRequest
impl Sync for ApiRequest
impl Unpin for ApiRequest
impl UnsafeUnpin for ApiRequest
impl UnwindSafe for ApiRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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