Struct kind_openai::endpoints::chat::ChatCompletionRequest
source · pub struct ChatCompletionRequest<'a, S> { /* private fields */ }
Expand description
A text chat completion request.
Implementations§
source§impl<'a, S> ChatCompletionRequest<'a, S>
impl<'a, S> ChatCompletionRequest<'a, S>
sourcepub fn new(model: ChatCompletionModel) -> Selfwhere
S: Sealed,
pub fn new(model: ChatCompletionModel) -> Selfwhere
S: Sealed,
Creates a new chat completion request for a given model.
Schema type must be internally defined and as such not an
OpenAISchema
, meaning that it will not be a structured response.
99% of the time, you want to use kopenai::UnstructuredString
here as
S
pub fn new_structured(model: ChatCompletionModel) -> Selfwhere
S: OpenAISchema,
sourcepub fn message(self, message: ChatCompletionRequestMessage<'a>) -> Self
pub fn message(self, message: ChatCompletionRequestMessage<'a>) -> Self
Adds a message to the request.
sourcepub fn temperature(self, temperature: f32) -> Self
pub fn temperature(self, temperature: f32) -> Self
Sets the request temperature.
Trait Implementations§
Auto Trait Implementations§
impl<'a, S> Freeze for ChatCompletionRequest<'a, S>
impl<'a, S> RefUnwindSafe for ChatCompletionRequest<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for ChatCompletionRequest<'a, S>where
S: Send,
impl<'a, S> Sync for ChatCompletionRequest<'a, S>where
S: Sync,
impl<'a, S> Unpin for ChatCompletionRequest<'a, S>where
S: Unpin,
impl<'a, S> UnwindSafe for ChatCompletionRequest<'a, S>where
S: UnwindSafe,
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