pub struct GenerationConfig {Show 15 fields
pub audio_timestamp: Option<bool>,
pub candidate_count: Option<i64>,
pub frequency_penalty: Option<f64>,
pub logprobs: Option<i64>,
pub max_output_tokens: Option<i64>,
pub presence_penalty: Option<f64>,
pub response_logprobs: Option<bool>,
pub response_mime_type: Option<String>,
pub response_schema: Option<Schema>,
pub routing_config: Option<GenerationConfigRoutingConfig>,
pub seed: Option<i64>,
pub stop_sequences: Option<Vec<String>>,
pub temperature: Option<f64>,
pub top_k: Option<f64>,
pub top_p: Option<f64>,
}Expand description
Configuration for generation settings.
Fields§
§audio_timestamp: Option<bool>Optional. If enabled, audio timestamp will be included.
candidate_count: Option<i64>Optional. Number of candidates to generate.
frequency_penalty: Option<f64>Optional. Frequency penalties.
logprobs: Option<i64>Optional. Logit probabilities.
max_output_tokens: Option<i64>Optional. The maximum number of output tokens to generate per message.
presence_penalty: Option<f64>Optional. Positive penalties.
response_logprobs: Option<bool>Optional. If true, export the logprobs results in response.
response_mime_type: Option<String>Optional. Output response MIME type of the generated candidate text.
response_schema: Option<Schema>Optional. Schema object allows the definition of input and output data types.
routing_config: Option<GenerationConfigRoutingConfig>Optional. Routing configuration.
seed: Option<i64>Optional. Seed.
stop_sequences: Option<Vec<String>>Optional. Stop sequences.
temperature: Option<f64>Optional. Controls the randomness of predictions.
top_k: Option<f64>Optional. If specified, top-k sampling will be used.
top_p: Option<f64>Optional. If specified, nucleus sampling will be used.
Implementations§
Source§impl GenerationConfig
impl GenerationConfig
Sourcepub fn audio_timestamp(self, value: impl Into<bool>) -> Self
pub fn audio_timestamp(self, value: impl Into<bool>) -> Self
Sets the audio_timestamp field of this struct.
Sourcepub fn candidate_count(self, value: impl Into<i64>) -> Self
pub fn candidate_count(self, value: impl Into<i64>) -> Self
Sets the candidate_count field of this struct.
Sourcepub fn frequency_penalty(self, value: impl Into<f64>) -> Self
pub fn frequency_penalty(self, value: impl Into<f64>) -> Self
Sets the frequency_penalty field of this struct.
Sourcepub fn max_output_tokens(self, value: impl Into<i64>) -> Self
pub fn max_output_tokens(self, value: impl Into<i64>) -> Self
Sets the max_output_tokens field of this struct.
Sourcepub fn presence_penalty(self, value: impl Into<f64>) -> Self
pub fn presence_penalty(self, value: impl Into<f64>) -> Self
Sets the presence_penalty field of this struct.
Sourcepub fn response_logprobs(self, value: impl Into<bool>) -> Self
pub fn response_logprobs(self, value: impl Into<bool>) -> Self
Sets the response_logprobs field of this struct.
Sourcepub fn response_mime_type(self, value: impl Into<String>) -> Self
pub fn response_mime_type(self, value: impl Into<String>) -> Self
Sets the response_mime_type field of this struct.
Sourcepub fn response_schema(self, value: impl Into<Schema>) -> Self
pub fn response_schema(self, value: impl Into<Schema>) -> Self
Sets the response_schema field of this struct.
Sourcepub fn routing_config(
self,
value: impl Into<GenerationConfigRoutingConfig>,
) -> Self
pub fn routing_config( self, value: impl Into<GenerationConfigRoutingConfig>, ) -> Self
Sets the routing_config field of this struct.
Sourcepub fn stop_sequences(self, value: impl Into<Vec<String>>) -> Self
pub fn stop_sequences(self, value: impl Into<Vec<String>>) -> Self
Sets the stop_sequences field of this struct.
Sourcepub fn temperature(self, value: impl Into<f64>) -> Self
pub fn temperature(self, value: impl Into<f64>) -> Self
Sets the temperature field of this struct.
Trait Implementations§
Source§impl Clone for GenerationConfig
impl Clone for GenerationConfig
Source§fn clone(&self) -> GenerationConfig
fn clone(&self) -> GenerationConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more