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
Trait Implementations§
Source§impl Debug for ChatCompletionRequest
impl Debug for ChatCompletionRequest
Source§impl<'de> Deserialize<'de> for ChatCompletionRequest
impl<'de> Deserialize<'de> for ChatCompletionRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ChatCompletionRequest
impl RefUnwindSafe for ChatCompletionRequest
impl Send for ChatCompletionRequest
impl Sync for ChatCompletionRequest
impl Unpin for ChatCompletionRequest
impl UnsafeUnpin for ChatCompletionRequest
impl UnwindSafe for ChatCompletionRequest
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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