pub struct ThinkingConfig {
pub thinking_budget: Option<i32>,
pub include_thoughts: Option<bool>,
}
Expand description
Configuration for thinking (Gemini 2.5 series only)
Fields§
§thinking_budget: Option<i32>
The thinking budget (number of thinking tokens)
- Set to 0 to disable thinking
- Set to -1 for dynamic thinking (model decides)
- Set to a positive number for a specific token budget
Model-specific ranges:
- 2.5 Pro: 128 to 32768 (cannot disable thinking)
- 2.5 Flash: 0 to 24576
- 2.5 Flash Lite: 512 to 24576
include_thoughts: Option<bool>
Whether to include thought summaries in the response
When enabled, the response will include synthesized versions of the model’s raw thoughts, providing insights into the reasoning process.
Implementations§
Source§impl ThinkingConfig
impl ThinkingConfig
Sourcepub fn with_thinking_budget(self, budget: i32) -> Self
pub fn with_thinking_budget(self, budget: i32) -> Self
Set the thinking budget
Sourcepub fn with_dynamic_thinking(self) -> Self
pub fn with_dynamic_thinking(self) -> Self
Enable dynamic thinking (model decides the budget)
Sourcepub fn with_thoughts_included(self, include: bool) -> Self
pub fn with_thoughts_included(self, include: bool) -> Self
Include thought summaries in the response
Trait Implementations§
Source§impl Clone for ThinkingConfig
impl Clone for ThinkingConfig
Source§fn clone(&self) -> ThinkingConfig
fn clone(&self) -> ThinkingConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 ThinkingConfig
impl Debug for ThinkingConfig
Source§impl Default for ThinkingConfig
impl Default for ThinkingConfig
Source§impl<'de> Deserialize<'de> for ThinkingConfig
impl<'de> Deserialize<'de> for ThinkingConfig
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 ThinkingConfig
impl RefUnwindSafe for ThinkingConfig
impl Send for ThinkingConfig
impl Sync for ThinkingConfig
impl Unpin for ThinkingConfig
impl UnwindSafe for ThinkingConfig
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