pub struct ChatCompletionRequest { /* private fields */ }
Expand description
Struct representing a request for chat completions.
Implementations§
Source§impl ChatCompletionRequest
impl ChatCompletionRequest
Sourcepub fn new(model: String, messages: Vec<Value>) -> Self
pub fn new(model: String, messages: Vec<Value>) -> Self
Create a new instance of ChatCompletionRequest
.
Sourcepub fn new_json(model: String, messages: Vec<Value>) -> Self
pub fn new_json(model: String, messages: Vec<Value>) -> Self
Create a new instance with JSON response format
Sourcepub fn new_json_schema(
model: String,
messages: Vec<Value>,
schema_name: String,
schema: Value,
) -> Self
pub fn new_json_schema( model: String, messages: Vec<Value>, schema_name: String, schema: Value, ) -> Self
Create a new instance with JSON Schema response format
pub fn max_tokens(self, max_tokens: u64) -> Self
pub fn temperature(self, temperature: f64) -> Self
pub fn top_p(self, top_p: f64) -> Self
pub fn n(self, n: u64) -> Self
pub fn stream(self, stream: bool) -> Self
pub fn stop(self, stop: Vec<String>) -> Self
pub fn presence_penalty(self, presence_penalty: f64) -> Self
pub fn frequency_penalty(self, frequency_penalty: f64) -> Self
pub fn logit_bias(self, logit_bias: Value) -> Self
pub fn user(self, user: String) -> Self
pub fn response_format(self, response_format: ResponseFormat) -> Self
Trait Implementations§
Source§impl Default for ChatCompletionRequest
impl Default for ChatCompletionRequest
Source§fn default() -> ChatCompletionRequest
fn default() -> ChatCompletionRequest
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ChatCompletionRequest
impl RefUnwindSafe for ChatCompletionRequest
impl Send for ChatCompletionRequest
impl Sync for ChatCompletionRequest
impl Unpin 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
Mutably borrows from an owned value. Read more