pub struct ChatCompletionRequest {Show 21 fields
pub model: String,
pub messages: Vec<Message>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub max_tokens: Option<u32>,
pub max_completion_tokens: Option<u32>,
pub stream: bool,
pub stream_options: Option<Value>,
pub tools: Vec<Tool>,
pub tool_choice: Option<ToolChoice>,
pub response_format: Option<ResponseFormat>,
pub stop: Vec<String>,
pub presence_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub n: Option<u32>,
pub seed: Option<i64>,
pub user: Option<String>,
pub parallel_tool_calls: Option<bool>,
pub reasoning_effort: Option<String>,
pub tt_extras: HashMap<String, Value>,
pub extra: HashMap<String, Value>,
}Fields§
§model: String§messages: Vec<Message>§temperature: Option<f32>§top_p: Option<f32>§max_tokens: Option<u32>§max_completion_tokens: Option<u32>Newer OpenAI spend cap for reasoning models (o3, o4-mini, …). When a
client sets this it MUST be honored end-to-end — dropping it silently
removes the caller’s output ceiling and changes spend.
stream: bool§stream_options: Option<Value>OpenAI stream_options (e.g. { "include_usage": true }). Kept as an
opaque value so the full object passes through to OpenAI-shaped upstreams
unchanged.
tools: Vec<Tool>§tool_choice: Option<ToolChoice>§response_format: Option<ResponseFormat>§stop: Vec<String>§presence_penalty: Option<f32>§frequency_penalty: Option<f32>§n: Option<u32>§seed: Option<i64>§user: Option<String>§parallel_tool_calls: Option<bool>Whether the model may emit tool calls in parallel (OpenAI
parallel_tool_calls). Forwarded to OpenAI-shaped upstreams.
reasoning_effort: Option<String>Reasoning-effort hint for reasoning models ("low"/"medium"/"high").
Materially changes output and cost, so it must reach the upstream when
supported.
tt_extras: HashMap<String, Value>TokenTrimmer-internal extras (cache config, route hints, etc.) that are stripped before forwarding to the provider.
extra: HashMap<String, Value>Genuinely-unknown / newer OpenAI fields not modeled above. Captured via
#[serde(flatten)] so they passthrough to OpenAI-shaped upstreams
instead of being silently dropped on deserialize. Never includes the
named fields above (serde consumes those first).
Trait Implementations§
Source§impl Clone for ChatCompletionRequest
impl Clone for ChatCompletionRequest
Source§fn clone(&self) -> ChatCompletionRequest
fn clone(&self) -> ChatCompletionRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more