pub struct CompletionRequestBuilder { /* private fields */ }Expand description
Builder for CompletionRequest.
Implementations§
Source§impl CompletionRequestBuilder
impl CompletionRequestBuilder
Sourcepub fn max_tokens(self, max_tokens: u32) -> Self
pub fn max_tokens(self, max_tokens: u32) -> Self
Set max_tokens.
Sourcepub fn temperature(self, temperature: f32) -> Self
pub fn temperature(self, temperature: f32) -> Self
Set temperature.
Sourcepub fn presence_penalty(self, penalty: f32) -> Self
pub fn presence_penalty(self, penalty: f32) -> Self
Set presence penalty.
Sourcepub fn frequency_penalty(self, penalty: f32) -> Self
pub fn frequency_penalty(self, penalty: f32) -> Self
Set frequency penalty.
Sourcepub fn response_format(self, format: ResponseFormat) -> Self
pub fn response_format(self, format: ResponseFormat) -> Self
Set response format.
Sourcepub fn json_schema(self, name: impl Into<String>, schema: Value) -> Self
pub fn json_schema(self, name: impl Into<String>, schema: Value) -> Self
Enable structured output with JSON schema.
Sourcepub fn build(self) -> Result<CompletionRequest>
pub fn build(self) -> Result<CompletionRequest>
Build and validate the request.
Trait Implementations§
Source§impl Clone for CompletionRequestBuilder
impl Clone for CompletionRequestBuilder
Source§fn clone(&self) -> CompletionRequestBuilder
fn clone(&self) -> CompletionRequestBuilder
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 Debug for CompletionRequestBuilder
impl Debug for CompletionRequestBuilder
Source§impl Default for CompletionRequestBuilder
impl Default for CompletionRequestBuilder
Source§fn default() -> CompletionRequestBuilder
fn default() -> CompletionRequestBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CompletionRequestBuilder
impl RefUnwindSafe for CompletionRequestBuilder
impl Send for CompletionRequestBuilder
impl Sync for CompletionRequestBuilder
impl Unpin for CompletionRequestBuilder
impl UnwindSafe for CompletionRequestBuilder
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