#[non_exhaustive]pub struct ChatRequest {
pub model: String,
pub messages: Vec<ChatMessage>,
pub tools: Vec<ToolSchema>,
pub temperature: Option<f32>,
pub max_tokens: Option<u32>,
pub effort: Option<String>,
pub response_format: Option<Value>,
pub extra_body: Map<String, Value>,
}Expand description
A single completion request.
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.model: StringModel id.
messages: Vec<ChatMessage>Full conversation so far.
tools: Vec<ToolSchema>Tools to advertise (may be empty).
temperature: Option<f32>Optional sampling temperature.
max_tokens: Option<u32>Optional output token cap.
effort: Option<String>Reasoning/effort level (sent as reasoning_effort), e.g. "low"/"high".
response_format: Option<Value>Structured-output constraint (sent as response_format), e.g. a
{"type":"json_schema", ...} object.
extra_body: Map<String, Value>Arbitrary extra fields merged into the request body — the escape hatch for provider-native features (prompt caching, Anthropic/OpenAI-specific knobs) not modeled above.
Implementations§
Source§impl ChatRequest
impl ChatRequest
Trait Implementations§
Source§impl Clone for ChatRequest
impl Clone for ChatRequest
Source§fn clone(&self) -> ChatRequest
fn clone(&self) -> ChatRequest
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 ChatRequest
impl Debug for ChatRequest
Source§impl PartialEq for ChatRequest
impl PartialEq for ChatRequest
impl StructuralPartialEq for ChatRequest
Auto Trait Implementations§
impl Freeze for ChatRequest
impl RefUnwindSafe for ChatRequest
impl Send for ChatRequest
impl Sync for ChatRequest
impl Unpin for ChatRequest
impl UnsafeUnpin for ChatRequest
impl UnwindSafe for ChatRequest
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