Struct chatgpt::config::ModelConfiguration
source · 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: ChatGPTEngine
The GPT version used.
temperature: f32
Controls randomness of the output. Higher values means more random
top_p: f32
Controls 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: f32
Determines how much to penalize new tokens passed on their existing presence so far
frequency_penalty: f32
Determines how much to penalize new tokens based on their existing frequency so far
reply_count: u32
The maximum amount of replies
api_url: Url
URL of the /v1/chat/completions endpoint. Can be used to set a proxy
timeout: Duration
Timeout for the http requests sent to avoid potentially permanently hanging requests.
function_validation: FunctionValidationStrategy
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<ModelConfiguration> for ModelConfiguration
impl PartialEq<ModelConfiguration> for ModelConfiguration
source§fn eq(&self, other: &ModelConfiguration) -> bool
fn eq(&self, other: &ModelConfiguration) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ModelConfiguration> for ModelConfiguration
impl PartialOrd<ModelConfiguration> for ModelConfiguration
source§fn partial_cmp(&self, other: &ModelConfiguration) -> Option<Ordering>
fn partial_cmp(&self, other: &ModelConfiguration) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more