pub struct ChatRequest {
pub model: String,
pub messages: Vec<Message>,
pub n: u32,
pub top_p: f64,
pub stream: bool,
pub temperature: f64,
pub max_tokens: Option<u32>,
}
Expand description
Request payload for a chat completion.
Fields§
§model: String
The model identifier to use.
messages: Vec<Message>
The list of messages to send.
n: u32
Number of chat completions to generate.
top_p: f64
Nucleus sampling probability.
stream: bool
Whether to stream the response.
temperature: f64
Sampling temperature.
max_tokens: Option<u32>
Optional maximum number of tokens to generate.
Trait Implementations§
Source§impl Debug for ChatRequest
impl Debug for ChatRequest
Source§impl<'de> Deserialize<'de> for ChatRequest
impl<'de> Deserialize<'de> for ChatRequest
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ChatRequest
impl RefUnwindSafe for ChatRequest
impl Send for ChatRequest
impl Sync for ChatRequest
impl Unpin for ChatRequest
impl UnwindSafe for ChatRequest
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
Mutably borrows from an owned value. Read more