Skip to content

Commit 8b0f0b5

Browse files
authored
Merge pull request pipecat-ai#3425 from pipecat-ai/pk/gemini-3-flash-new-thinking-levels
Add Gemini 3 Flash-specific thinking levels
2 parents a298ce3 + f5e8a04 commit 8b0f0b5

3 files changed

Lines changed: 78 additions & 69 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
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" ]
@@ -111,7 +111,7 @@ tavus=[]
111111
together = []
112112
tracing = [ "opentelemetry-sdk>=1.33.0", "opentelemetry-api>=1.33.0", "opentelemetry-instrumentation>=0.54b0" ]
113113
ultravox = [ "pipecat-ai[websockets-base]" ]
114-
webrtc = [ "aiortc>=1.13.0,<2", "opencv-python>=4.11.0.86,<5" ]
114+
webrtc = [ "aiortc>=1.14.0,<2", "opencv-python>=4.11.0.86,<5" ]
115115
websocket = [ "pipecat-ai[websockets-base]", "fastapi>=0.115.6,<0.122.0" ]
116116
websockets-base = [ "websockets>=13.1,<16.0" ]
117117
whisper = [ "faster-whisper~=1.1.1" ]

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

0 commit comments

Comments
 (0)