pub struct CompletionRequestBuilder {
pub prompt: String,
pub max_tokens: Option<u32>,
pub temperature: Option<f32>,
}Expand description
Builder for constructing completion requests with optional parameters.
Fields§
§prompt: StringThe input prompt text to complete
max_tokens: Option<u32>Optional maximum number of tokens to generate
temperature: Option<f32>Optional temperature parameter to control randomness (0.0-1.0)
Implementations§
Source§impl CompletionRequestBuilder
impl CompletionRequestBuilder
Sourcepub fn max_tokens(self, val: u32) -> Self
pub fn max_tokens(self, val: u32) -> Self
Sets the maximum number of tokens to generate.
Sourcepub fn temperature(self, val: f32) -> Self
pub fn temperature(self, val: f32) -> Self
Sets the temperature parameter for controlling randomness.
Sourcepub fn build(self) -> CompletionRequest
pub fn build(self) -> CompletionRequest
Builds the completion request with the configured parameters.
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 moreAuto 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more