pub struct ModelConfiguration {
pub engine: ChatGPTEngine,
pub temperature: f32,
pub top_p: f32,
pub max_tokens: Option<u32>,
pub presence_penalty: f32,
pub frequency_penalty: f32,
pub reply_count: u32,
pub api_url: Url,
pub timeout: Duration,
pub function_validation: FunctionValidationStrategy,
}Expand description
The struct containing main configuration for the ChatGPT API
Fields§
§engine: ChatGPTEngineThe GPT version used.
temperature: f32Controls randomness of the output. Higher values means more random
top_p: f32Controls diversity via nucleus sampling, not recommended to use with temperature
max_tokens: Option<u32>Controls the maximum number of tokens to generate in the completion
presence_penalty: f32Determines how much to penalize new tokens passed on their existing presence so far
frequency_penalty: f32Determines how much to penalize new tokens based on their existing frequency so far
reply_count: u32The maximum amount of replies
api_url: UrlURL of the /v1/chat/completions endpoint. Can be used to set a proxy
timeout: DurationTimeout for the http requests sent to avoid potentially permanently hanging requests.
function_validation: FunctionValidationStrategyfunctions only.Strategy for function validation strategy. Whenever ChatGPT fails to call a function correctly, this strategy is applied.
Trait Implementations§
Source§impl Clone for ModelConfiguration
impl Clone for ModelConfiguration
Source§fn clone(&self) -> ModelConfiguration
fn clone(&self) -> ModelConfiguration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModelConfiguration
impl Debug for ModelConfiguration
Source§impl Default for ModelConfiguration
impl Default for ModelConfiguration
Source§impl PartialEq for ModelConfiguration
impl PartialEq for ModelConfiguration
Source§impl PartialOrd for ModelConfiguration
impl PartialOrd for ModelConfiguration
impl StructuralPartialEq for ModelConfiguration
Auto Trait Implementations§
impl Freeze for ModelConfiguration
impl RefUnwindSafe for ModelConfiguration
impl Send for ModelConfiguration
impl Sync for ModelConfiguration
impl Unpin for ModelConfiguration
impl UnwindSafe for ModelConfiguration
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
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>
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>
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