From 0472c4f47be7936e0f22e7f9d8003c02ef003d93 Mon Sep 17 00:00:00 2001 From: Olivier Lacroix Date: Fri, 5 Dec 2025 16:30:18 +1100 Subject: [PATCH 1/2] emit_replace=True is never called --- pipelines/google/google_gemini.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/pipelines/google/google_gemini.py b/pipelines/google/google_gemini.py index 90fbcd0..7b8a080 100644 --- a/pipelines/google/google_gemini.py +++ b/pipelines/google/google_gemini.py @@ -1778,8 +1778,6 @@ async def _process_grounding_metadata( grounding_metadata_list: List[types.GroundingMetadata], text: str, __event_emitter__: Callable, - *, - emit_replace: bool = True, ): """Process and emit grounding metadata events.""" grounding_chunks = [] @@ -1847,17 +1845,8 @@ async def _process_grounding_metadata( cited_chunks.append(text_bytes[last_byte_index:].decode(ENCODING)) replaced_text = "".join(cited_chunks) - if emit_replace: - await __event_emitter__( - { - "type": "replace", - "data": {"content": replaced_text}, - } - ) - # Return the transformed text when requested by caller - if not emit_replace: - return replaced_text if replaced_text is not None else text + return replaced_text if replaced_text is not None else text async def _handle_streaming_response( self, @@ -1995,12 +1984,10 @@ async def emit_chat_event(event_type: str, data: Dict[str, Any]) -> None: # After processing all chunks, handle grounding data final_answer_text = "".join(answer_chunks) if grounding_metadata_list and __event_emitter__: - # Don't emit replace here; we'll compose final content below cited = await self._process_grounding_metadata( grounding_metadata_list, final_answer_text, __event_emitter__, - emit_replace=False, ) final_answer_text = cited or final_answer_text @@ -2378,7 +2365,6 @@ async def get_response(): grounding_metadata_list, final_answer, __event_emitter__, - emit_replace=False, ) final_answer = cited or final_answer From 0b0190ad731c5c0e26c4d9a701d201fbb52c135d Mon Sep 17 00:00:00 2001 From: owndev <69784886+owndev@users.noreply.github.com> Date: Mon, 8 Dec 2025 08:48:11 +0100 Subject: [PATCH 2/2] fix(google_gemini.py): increment version to 1.9.1 --- pipelines/google/google_gemini.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/google/google_gemini.py b/pipelines/google/google_gemini.py index 88544e3..0c1c1f9 100644 --- a/pipelines/google/google_gemini.py +++ b/pipelines/google/google_gemini.py @@ -4,7 +4,7 @@ author_url: https://github.com/owndev/ project_url: https://github.com/owndev/Open-WebUI-Functions funding_url: https://github.com/sponsors/owndev -version: 1.9.0 +version: 1.9.1 required_open_webui_version: 0.6.26 license: Apache License 2.0 description: Highly optimized Google Gemini pipeline with advanced image generation capabilities, intelligent compression, and streamlined processing workflows.