pub struct ModelConfigurationBuilder { /* private fields */ }
Expand description
Builder for ModelConfiguration
.
Implementations§
Source§impl ModelConfigurationBuilder
impl ModelConfigurationBuilder
Sourcepub fn engine<VALUE: Into<ChatGPTEngine>>(&mut self, value: VALUE) -> &mut Self
pub fn engine<VALUE: Into<ChatGPTEngine>>(&mut self, value: VALUE) -> &mut Self
The GPT version used.
Sourcepub fn temperature<VALUE: Into<f32>>(&mut self, value: VALUE) -> &mut Self
pub fn temperature<VALUE: Into<f32>>(&mut self, value: VALUE) -> &mut Self
Controls randomness of the output. Higher values means more random
Sourcepub fn top_p<VALUE: Into<f32>>(&mut self, value: VALUE) -> &mut Self
pub fn top_p<VALUE: Into<f32>>(&mut self, value: VALUE) -> &mut Self
Controls diversity via nucleus sampling, not recommended to use with temperature
Sourcepub fn max_tokens<VALUE: Into<Option<u32>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn max_tokens<VALUE: Into<Option<u32>>>( &mut self, value: VALUE, ) -> &mut Self
Controls the maximum number of tokens to generate in the completion
Sourcepub fn presence_penalty<VALUE: Into<f32>>(&mut self, value: VALUE) -> &mut Self
pub fn presence_penalty<VALUE: Into<f32>>(&mut self, value: VALUE) -> &mut Self
Determines how much to penalize new tokens passed on their existing presence so far
Sourcepub fn frequency_penalty<VALUE: Into<f32>>(&mut self, value: VALUE) -> &mut Self
pub fn frequency_penalty<VALUE: Into<f32>>(&mut self, value: VALUE) -> &mut Self
Determines how much to penalize new tokens based on their existing frequency so far
Sourcepub fn reply_count<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
pub fn reply_count<VALUE: Into<u32>>(&mut self, value: VALUE) -> &mut Self
The maximum amount of replies
Sourcepub fn api_url<VALUE: Into<Url>>(&mut self, value: VALUE) -> &mut Self
pub fn api_url<VALUE: Into<Url>>(&mut self, value: VALUE) -> &mut Self
URL of the /v1/chat/completions endpoint. Can be used to set a proxy
Sourcepub fn timeout<VALUE: Into<Duration>>(&mut self, value: VALUE) -> &mut Self
pub fn timeout<VALUE: Into<Duration>>(&mut self, value: VALUE) -> &mut Self
Timeout for the http requests sent to avoid potentially permanently hanging requests.
Sourcepub fn function_validation<VALUE: Into<FunctionValidationStrategy>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn function_validation<VALUE: Into<FunctionValidationStrategy>>( &mut self, value: VALUE, ) -> &mut Self
Strategy for function validation strategy. Whenever ChatGPT fails to call a function correctly, this strategy is applied.
Sourcepub fn build(
&self,
) -> Result<ModelConfiguration, ModelConfigurationBuilderError>
pub fn build( &self, ) -> Result<ModelConfiguration, ModelConfigurationBuilderError>
Trait Implementations§
Source§impl Clone for ModelConfigurationBuilder
impl Clone for ModelConfigurationBuilder
Source§fn clone(&self) -> ModelConfigurationBuilder
fn clone(&self) -> ModelConfigurationBuilder
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 ModelConfigurationBuilder
impl RefUnwindSafe for ModelConfigurationBuilder
impl Send for ModelConfigurationBuilder
impl Sync for ModelConfigurationBuilder
impl Unpin for ModelConfigurationBuilder
impl UnwindSafe for ModelConfigurationBuilder
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