pub struct ExtendedChatRequest {Show 16 fields
pub messages: Vec<ChatMessage>,
pub max_tokens: usize,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub stream: Option<bool>,
pub stop: Option<StopSequences>,
pub tools: Option<Vec<Tool>>,
pub tool_choice: Option<ToolChoice>,
pub logprobs: Option<bool>,
pub top_logprobs: Option<usize>,
pub response_format: Option<ResponseFormat>,
pub seed: Option<u64>,
pub n: Option<usize>,
pub presence_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub user: Option<String>,
}Expand description
A full OpenAI-compatible chat completion request including all optional fields.
Fields§
§messages: Vec<ChatMessage>The conversation messages.
max_tokens: usizeMaximum number of tokens to generate.
temperature: Option<f32>Sampling temperature (0.0 = greedy).
top_p: Option<f32>Nucleus sampling probability threshold.
stream: Option<bool>Whether to stream the response as SSE.
stop: Option<StopSequences>Sequences that stop generation.
tools: Option<Vec<Tool>>Tools available to the model.
tool_choice: Option<ToolChoice>Controls which tool is called, if any.
logprobs: Option<bool>Whether to return log probabilities for generated tokens.
top_logprobs: Option<usize>Number of top alternative tokens to include in logprobs (0–20).
response_format: Option<ResponseFormat>Format constraint for the response.
seed: Option<u64>Seed for deterministic generation.
n: Option<usize>Number of independent completions to generate (default 1, max 4).
presence_penalty: Option<f32>Penalty applied for tokens that are present in the context.
frequency_penalty: Option<f32>Penalty applied proportional to a token’s frequency in the context.
user: Option<String>An optional identifier for the end user.
Trait Implementations§
Source§impl Debug for ExtendedChatRequest
impl Debug for ExtendedChatRequest
Source§impl<'de> Deserialize<'de> for ExtendedChatRequest
impl<'de> Deserialize<'de> for ExtendedChatRequest
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 ExtendedChatRequest
impl RefUnwindSafe for ExtendedChatRequest
impl Send for ExtendedChatRequest
impl Sync for ExtendedChatRequest
impl Unpin for ExtendedChatRequest
impl UnsafeUnpin for ExtendedChatRequest
impl UnwindSafe for ExtendedChatRequest
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
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