From bd086de373166e0ae928a1589640547f9e2a9eb7 Mon Sep 17 00:00:00 2001 From: Stefan Warnat Date: Thu, 16 Apr 2026 09:38:58 +0200 Subject: [PATCH] fix: Allow to use custom Thinking Text output within Gemini --- pipelines/google/google_gemini.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pipelines/google/google_gemini.py b/pipelines/google/google_gemini.py index 41e63a0..ec21b09 100644 --- a/pipelines/google/google_gemini.py +++ b/pipelines/google/google_gemini.py @@ -415,6 +415,15 @@ class Valves(BaseModel): description="Maximum time in seconds to wait for video generation before timing out (0=no limit).", ) + TEXT_THOUGHT: str = Field( + default=os.getenv("GOOGLE_TEXT_THOUGHT", "Thought"), + description="Text shown as 'Thought'.", + ) + TEXT_THINKING: str = Field( + default=os.getenv("GOOGLE_TEXT_THINKING", "Thinking"), + description="Text shown as 'Thinking'.", + ) + # ---------------- Internal Helpers ---------------- # async def _gather_history_images( self, @@ -2685,7 +2694,7 @@ async def emit_chat_event(event_type: str, data: Dict[str, Any]) -> None: "type": "status", "data": { "action": "thinking", - "description": f"Thinking… {preview}", + "description": f"{self.valves.TEXT_THINKING}… {preview}", "done": False, "hidden": False, }, @@ -2734,7 +2743,7 @@ async def emit_chat_event(event_type: str, data: Dict[str, Any]) -> None: quoted_content = "\n".join(quoted_lines) details_block = f"""
-Thought ({duration_s}s) +{self.valves.TEXT_THOUGHT} ({duration_s}s) {quoted_content} @@ -3339,7 +3348,7 @@ async def get_response(): quoted_content = "\n".join(quoted_lines) details_block = f"""
-Thought ({duration_s}s) +{self.valves.TEXT_THOUGHT} ({duration_s}s) {quoted_content}