#[non_exhaustive]pub struct GenerationConfig {
pub thinking_config: ThinkingConfig,
pub top_k: Option<u32>,
pub presence_penalty: Option<f64>,
pub frequency_penalty: Option<f64>,
pub response_logprobs: Option<bool>,
pub logprobs: Option<u32>,
pub candidate_count: Option<CandidateCount>,
pub response_modalities: Vec<ResponseModality>,
pub image_config: Option<ImageConfig>,
pub speech_config: Option<SpeechConfig>,
pub media_resolution: Option<MediaResolution>,
}Expand description
The generationConfig entries the Gemini API, Vertex AI and the gRPC
API all take. None of them is one a request or its generation options
write: temperature, maxOutputTokens, topP, seed, stopSequences
and the thinking level or budget are set there.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.thinking_config: ThinkingConfigthinkingConfig.includeThoughts, next to the thinking level or
budget the request’s reasoning sets.
top_k: Option<u32>topK.
presence_penalty: Option<f64>presencePenalty.
frequency_penalty: Option<f64>frequencyPenalty.
response_logprobs: Option<bool>responseLogprobs: return the chosen tokens’ log probabilities.
logprobs: Option<u32>logprobs: how many top candidates to return per token.
candidate_count: Option<CandidateCount>candidateCount.
response_modalities: Vec<ResponseModality>responseModalities.
image_config: Option<ImageConfig>imageConfig.
speech_config: Option<SpeechConfig>speechConfig.
media_resolution: Option<MediaResolution>mediaResolution.
Implementations§
Source§impl GenerationConfig
impl GenerationConfig
Sourcepub fn include_thoughts(self, include: bool) -> Self
pub fn include_thoughts(self, include: bool) -> Self
thinkingConfig.includeThoughts: return thought summaries.
Sourcepub fn presence_penalty(self, penalty: f64) -> Self
pub fn presence_penalty(self, penalty: f64) -> Self
presencePenalty.
Sourcepub fn frequency_penalty(self, penalty: f64) -> Self
pub fn frequency_penalty(self, penalty: f64) -> Self
frequencyPenalty.
Sourcepub fn response_logprobs(self, enable: bool) -> Self
pub fn response_logprobs(self, enable: bool) -> Self
responseLogprobs.
Sourcepub fn candidate_count(self, count: CandidateCount) -> Self
pub fn candidate_count(self, count: CandidateCount) -> Self
candidateCount.
Sourcepub fn response_modalities(
self,
modalities: impl IntoIterator<Item = ResponseModality>,
) -> Self
pub fn response_modalities( self, modalities: impl IntoIterator<Item = ResponseModality>, ) -> Self
responseModalities.
Sourcepub fn image_config(self, config: ImageConfig) -> Self
pub fn image_config(self, config: ImageConfig) -> Self
imageConfig.
Sourcepub fn speech_config(self, config: SpeechConfig) -> Self
pub fn speech_config(self, config: SpeechConfig) -> Self
speechConfig.
Sourcepub fn media_resolution(self, resolution: MediaResolution) -> Self
pub fn media_resolution(self, resolution: MediaResolution) -> Self
mediaResolution.
Trait Implementations§
Source§impl Clone for GenerationConfig
impl Clone for GenerationConfig
Source§impl Debug for GenerationConfig
impl Debug for GenerationConfig
Source§impl Default for GenerationConfig
impl Default for GenerationConfig
Source§impl PartialEq for GenerationConfig
impl PartialEq for GenerationConfig
Source§impl Serialize for GenerationConfig
impl Serialize for GenerationConfig
impl StructuralPartialEq for GenerationConfig
Auto Trait Implementations§
impl Freeze for GenerationConfig
impl RefUnwindSafe for GenerationConfig
impl Send for GenerationConfig
impl Sync for GenerationConfig
impl Unpin for GenerationConfig
impl UnsafeUnpin for GenerationConfig
impl UnwindSafe for GenerationConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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