pub struct GenerationConfig {
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<i32>,
pub max_output_tokens: Option<i32>,
pub candidate_count: Option<i32>,
pub stop_sequences: Option<Vec<String>>,
pub response_mime_type: Option<String>,
pub response_schema: Option<Value>,
}
Expand description
Configuration for generation
Fields§
§temperature: Option<f32>
The temperature for the model (0.0 to 1.0)
Controls the randomness of the output. Higher values (e.g., 0.9) make output more random, lower values (e.g., 0.1) make output more deterministic.
top_p: Option<f32>
The top-p value for the model (0.0 to 1.0)
For each token generation step, the model considers the top_p percentage of probability mass for potential token choices. Lower values are more selective, higher values allow more variety.
top_k: Option<i32>
The top-k value for the model
For each token generation step, the model considers the top_k most likely tokens. Lower values are more selective, higher values allow more variety.
max_output_tokens: Option<i32>
The maximum number of tokens to generate
Limits the length of the generated content. One token is roughly 4 characters.
candidate_count: Option<i32>
The candidate count
Number of alternative responses to generate.
stop_sequences: Option<Vec<String>>
Whether to stop on specific sequences
The model will stop generating content when it encounters any of these sequences.
response_mime_type: Option<String>
The response mime type
Specifies the format of the model’s response.
response_schema: Option<Value>
The response schema
Specifies the JSON schema for structured responses.
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