Skip to content

Commit 76a0581

Browse files
committed
Add Gemini 3 Flash-specific thinking levels
1 parent f6ed7d7 commit 76a0581

3 files changed

Lines changed: 20 additions & 61 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fal = [ "fal-client~=0.5.9" ]
6262
fireworks = []
6363
fish = [ "ormsgpack~=1.7.0", "pipecat-ai[websockets-base]" ]
6464
gladia = [ "pipecat-ai[websockets-base]" ]
65-
google = [ "google-cloud-speech>=2.33.0,<3", "google-cloud-texttospeech>=2.31.0,<3", "google-genai>=1.51.0,<2", "pipecat-ai[websockets-base]" ]
65+
google = [ "google-cloud-speech>=2.33.0,<3", "google-cloud-texttospeech>=2.31.0,<3", "google-genai>=1.57.0,<2", "pipecat-ai[websockets-base]" ]
6666
gradium = [ "pipecat-ai[websockets-base]" ]
6767
grok = []
6868
groq = [ "groq~=0.23.0" ]

src/pipecat/services/google/llm.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -708,16 +708,18 @@ class ThinkingConfig(BaseModel):
708708
Gemini 2.5 and 3 series models have this thinking process.
709709
710710
Parameters:
711-
thinking_level: Thinking level for Gemini 3 Pro. Can be "low" or "high".
712-
If not provided, Gemini 3 Pro defaults to "high".
713-
Note: Gemini 2.5 series should use thinking_budget instead.
711+
thinking_level: Thinking level for Gemini 3 models.
712+
For Gemini 3 Pro, this can be "low" or "high".
713+
For Gemini 3 Flash, this can be "minimal", "low", "medium", or "high".
714+
If not provided, Gemini 3 models default to "high".
715+
Note: Gemini 2.5 series must use thinking_budget instead.
714716
thinking_budget: Token budget for thinking, for Gemini 2.5 series.
715717
-1 for dynamic thinking (model decides), 0 to disable thinking,
716718
or a specific token count (e.g., 128-32768 for 2.5 Pro).
717719
If not provided, most models today default to dynamic thinking.
718720
See https://ai.google.dev/gemini-api/docs/thinking#set-budget
719721
for default values and allowed ranges.
720-
Note: Gemini 3 Pro should use thinking_level instead.
722+
Note: Gemini 3 models must use thinking_level instead.
721723
include_thoughts: Whether to include thought summaries in the response.
722724
Today's models default to not including thoughts (False).
723725
"""
@@ -726,7 +728,9 @@ class ThinkingConfig(BaseModel):
726728

727729
# Why `| str` here? To not break compatibility in case Google adds more
728730
# levels in the future.
729-
thinking_level: Optional[Literal["low", "high"] | str] = Field(default=None)
731+
thinking_level: Optional[Literal["low", "high", "medium", "minimal"] | str] = Field(
732+
default=None
733+
)
730734

731735
include_thoughts: Optional[bool] = Field(default=None)
732736

uv.lock

Lines changed: 10 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)