Skip to content

Commit 4943341

Browse files
authored
Merge pull request #83 from owndev/82-thinking-include_thoughts
fix(google/gemini): the THINKING_ENABLED option has been replaced by the INCLUDE_THOUGHTS switch for Gemini's thought output.
2 parents 1e89d8b + 0fa6c76 commit 4943341

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pipelines/google/google_gemini.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
author_url: https://github.com/owndev/
55
project_url: https://github.com/owndev/Open-WebUI-Functions
66
funding_url: https://github.com/sponsors/owndev
7-
version: 1.6.5
7+
version: 1.6.6
88
license: Apache License 2.0
99
description: Highly optimized Google Gemini pipeline with advanced image generation capabilities, intelligent compression, and streamlined processing workflows.
1010
features:
@@ -158,14 +158,14 @@ class Valves(BaseModel):
158158
default=os.getenv("GOOGLE_API_VERSION", "v1alpha"),
159159
description="API version to use for Google Generative AI (e.g., v1alpha, v1beta, v1).",
160160
)
161-
THINKING_ENABLED: bool = Field(
162-
default=os.getenv("GOOGLE_THINKING_ENABLED", "true").lower() == "true",
163-
description="Enable Gemini thinking outputs (set false to disable).",
164-
)
165161
STREAMING_ENABLED: bool = Field(
166162
default=os.getenv("GOOGLE_STREAMING_ENABLED", "true").lower() == "true",
167163
description="Enable streaming responses (set false to force non-streaming mode).",
168164
)
165+
INCLUDE_THOUGHTS: bool = Field(
166+
default=os.getenv("GOOGLE_INCLUDE_THOUGHTS", "true").lower() == "true",
167+
description="Enable Gemini thoughts outputs (set false to disable).",
168+
)
169169
USE_VERTEX_AI: bool = Field(
170170
default=os.getenv("GOOGLE_GENAI_USE_VERTEXAI", "false").lower() == "true",
171171
description="Whether to use Google Cloud Vertex AI instead of the Google Generative AI API.",
@@ -1423,9 +1423,9 @@ def _configure_generation(
14231423

14241424
# Enable Gemini "Thinking" when requested (default: on) and supported by the model
14251425
include_thoughts = body.get("include_thoughts", True)
1426-
if not self.valves.THINKING_ENABLED:
1426+
if not self.valves.INCLUDE_THOUGHTS:
14271427
include_thoughts = False
1428-
self.log.debug("Thinking disabled via GOOGLE_THINKING_ENABLED")
1428+
self.log.debug("Thoughts disabled via GOOGLE_INCLUDE_THOUGHTS")
14291429

14301430
if include_thoughts and self._check_thinking_support(model_id):
14311431
try:

0 commit comments

Comments
 (0)