pub struct ChatCompletionRequest {
pub model: ModelField,
pub messages: Vec<ChatCompletionMessage>,
pub stream: bool,
pub temperature: Option<f32>,
pub max_tokens: Option<u32>,
pub strict_capabilities: Option<bool>,
pub tools: Option<Vec<ToolDefinition>>,
pub tool_choice: Option<ToolChoice>,
pub tool_execution: Option<ToolExecutionMode>,
pub response_format: Option<ResponseFormatRequest>,
pub top_p: Option<f32>,
pub stop: Option<StopField>,
}Expand description
OpenAI-compatible chat completion request
Accepts either a single model string or an array of model strings for multiplex mode. Each model string may contain a provider prefix (e.g., “copilot:gpt-4o”) parsed by the provider resolver.
Fields§
§model: ModelFieldModel identifier(s) — single string or array for multiplex
messages: Vec<ChatCompletionMessage>Conversation messages
stream: boolWhether to stream the response
temperature: Option<f32>Temperature for response randomness (0.0 - 2.0)
max_tokens: Option<u32>Maximum tokens to generate
strict_capabilities: Option<bool>Enable strict capability checking (reject unsupported parameters)
tools: Option<Vec<ToolDefinition>>Tool definitions for function calling
tool_choice: Option<ToolChoice>Controls which tools the model may call
tool_execution: Option<ToolExecutionMode>Where tool calls are executed (embacle extension)
client (default) returns tool_calls for the caller to execute and
resubmit. server runs an autonomous agent loop against the server’s
configured MCP tool servers and returns the final assistant message.
response_format: Option<ResponseFormatRequest>Controls the response format (text, json_object, or json_schema)
top_p: Option<f32>Nucleus sampling parameter (0.0 - 1.0)
stop: Option<StopField>Stop sequence(s) that halt generation — single string or array