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 service_tier: Option<String>,
pub thinking_budget: Option<u32>,
pub extra_body: Map<String, Value>,
}Expand description
A single model-completion request.
Fields§
§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, such as "low" or "high".
response_format: Option<Value>Structured-output constraint sent as response_format.
service_tier: Option<String>BP-13 (catalog D9 “Fast mode / service tiers”): the provider service
tier this request asks for ("auto", "priority", "flex", …).
Sent verbatim as the OpenAI-compatible service_tier field; None
omits it, which is what every pre-BP-13 caller produced.
thinking_budget: Option<u32>BP-13 (catalog D9 “Reasoning effort / thinking budgets”): a cap on
reasoning/thinking TOKENS for this request — Claude Code’s
MAX_THINKING_TOKENS, the budget half of effort’s level half.
Sent as the unified reasoning.max_tokens field; None omits it.
extra_body: Map<String, Value>Arbitrary provider-native request fields.
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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more