pub struct GenerateContentConfig {
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<i32>,
pub frequency_penalty: Option<f32>,
pub presence_penalty: Option<f32>,
pub max_output_tokens: Option<i32>,
pub seed: Option<i64>,
pub top_logprobs: Option<u8>,
pub stop_sequences: Vec<String>,
pub response_schema: Option<Value>,
pub cached_content: Option<String>,
pub extensions: Map<String, Value>,
}Expand description
Configuration for LLM content generation.
Fields§
§temperature: Option<f32>Sampling temperature (0.0 = deterministic, higher = more random).
top_p: Option<f32>Nucleus sampling threshold.
top_k: Option<i32>Top-k sampling parameter.
frequency_penalty: Option<f32>Frequency penalty to reduce repetition.
presence_penalty: Option<f32>Presence penalty to encourage topic diversity.
max_output_tokens: Option<i32>Maximum number of output tokens to generate.
seed: Option<i64>Random seed for reproducible generation.
top_logprobs: Option<u8>Number of top log probabilities to return per token.
stop_sequences: Vec<String>Sequences that stop generation when encountered.
response_schema: Option<Value>JSON Schema for structured output.
cached_content: Option<String>Optional cached content name for Gemini provider. When set, the Gemini provider attaches this to the generation request.
extensions: Map<String, Value>Provider-specific request options keyed by provider namespace.
Trait Implementations§
Source§impl Clone for GenerateContentConfig
impl Clone for GenerateContentConfig
Source§fn clone(&self) -> GenerateContentConfig
fn clone(&self) -> GenerateContentConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GenerateContentConfig
impl Debug for GenerateContentConfig
Source§impl Default for GenerateContentConfig
impl Default for GenerateContentConfig
Source§fn default() -> GenerateContentConfig
fn default() -> GenerateContentConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GenerateContentConfig
impl<'de> Deserialize<'de> for GenerateContentConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GenerateContentConfig
impl RefUnwindSafe for GenerateContentConfig
impl Send for GenerateContentConfig
impl Sync for GenerateContentConfig
impl Unpin for GenerateContentConfig
impl UnsafeUnpin for GenerateContentConfig
impl UnwindSafe for GenerateContentConfig
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