pub struct CreateChatCompletionRequest<'a> {
pub frequency_penalty: Option<f64>,
pub logit_bias: Option<Value>,
pub max_tokens: Option<i64>,
pub messages: Vec<ChatCompletionRequestMessage>,
pub model: String,
pub n: Option<i64>,
pub presence_penalty: Option<f64>,
pub stop: Option<Value>,
pub stream: Option<bool>,
pub temperature: Option<f64>,
pub top_p: Option<f64>,
pub user: Option<String>,
/* private fields */
}Expand description
Create this with the associated client method.
That method takes required values as arguments. Set optional values using builder methods on this struct.
Fields§
§frequency_penalty: Option<f64>§logit_bias: Option<Value>§max_tokens: Option<i64>§messages: Vec<ChatCompletionRequestMessage>§model: String§n: Option<i64>§presence_penalty: Option<f64>§stop: Option<Value>§stream: Option<bool>§temperature: Option<f64>§top_p: Option<f64>§user: Option<String>Implementations§
Source§impl<'a> CreateChatCompletionRequest<'a>
impl<'a> CreateChatCompletionRequest<'a>
pub async fn send(self) -> InMemoryResult<CreateChatCompletionResponse>
pub fn frequency_penalty(self, frequency_penalty: f64) -> Self
pub fn logit_bias(self, logit_bias: Value) -> Self
pub fn max_tokens(self, max_tokens: i64) -> Self
pub fn n(self, n: i64) -> Self
pub fn presence_penalty(self, presence_penalty: f64) -> Self
pub fn stop(self, stop: Value) -> Self
pub fn stream(self, stream: bool) -> Self
pub fn temperature(self, temperature: f64) -> Self
pub fn top_p(self, top_p: f64) -> Self
pub fn user(self, user: &str) -> Self
Trait Implementations§
Source§impl<'a> Clone for CreateChatCompletionRequest<'a>
impl<'a> Clone for CreateChatCompletionRequest<'a>
Source§fn clone(&self) -> CreateChatCompletionRequest<'a>
fn clone(&self) -> CreateChatCompletionRequest<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> IntoFuture for CreateChatCompletionRequest<'a>
impl<'a> IntoFuture for CreateChatCompletionRequest<'a>
Source§type Output = Result<CreateChatCompletionResponse, Error<InMemoryBody>>
type Output = Result<CreateChatCompletionResponse, Error<InMemoryBody>>
The output that the future will produce on completion.
Source§type IntoFuture = Pin<Box<dyn Future<Output = <CreateChatCompletionRequest<'a> as IntoFuture>::Output> + Send + 'a>>
type IntoFuture = Pin<Box<dyn Future<Output = <CreateChatCompletionRequest<'a> as IntoFuture>::Output> + Send + 'a>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<'a> Freeze for CreateChatCompletionRequest<'a>
impl<'a> !RefUnwindSafe for CreateChatCompletionRequest<'a>
impl<'a> Send for CreateChatCompletionRequest<'a>
impl<'a> Sync for CreateChatCompletionRequest<'a>
impl<'a> Unpin for CreateChatCompletionRequest<'a>
impl<'a> !UnwindSafe for CreateChatCompletionRequest<'a>
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