Skip to content

Commit 2477bb4

Browse files
authored
Merge pull request #116 from olivier-lacroix/chore/dead-code-removal
Some dead code removal
2 parents 5ae107d + 0b0190a commit 2477bb4

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

pipelines/google/google_gemini.py

Lines changed: 2 additions & 16 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.9.0
7+
version: 1.9.1
88
required_open_webui_version: 0.6.26
99
license: Apache License 2.0
1010
description: Highly optimized Google Gemini pipeline with advanced image generation capabilities, intelligent compression, and streamlined processing workflows.
@@ -1786,8 +1786,6 @@ async def _process_grounding_metadata(
17861786
grounding_metadata_list: List[types.GroundingMetadata],
17871787
text: str,
17881788
__event_emitter__: Callable,
1789-
*,
1790-
emit_replace: bool = True,
17911789
):
17921790
"""Process and emit grounding metadata events."""
17931791
grounding_chunks = []
@@ -1855,17 +1853,8 @@ async def _process_grounding_metadata(
18551853
cited_chunks.append(text_bytes[last_byte_index:].decode(ENCODING))
18561854

18571855
replaced_text = "".join(cited_chunks)
1858-
if emit_replace:
1859-
await __event_emitter__(
1860-
{
1861-
"type": "replace",
1862-
"data": {"content": replaced_text},
1863-
}
1864-
)
18651856

1866-
# Return the transformed text when requested by caller
1867-
if not emit_replace:
1868-
return replaced_text if replaced_text is not None else text
1857+
return replaced_text if replaced_text is not None else text
18691858

18701859
async def _handle_streaming_response(
18711860
self,
@@ -2003,12 +1992,10 @@ async def emit_chat_event(event_type: str, data: Dict[str, Any]) -> None:
20031992
# After processing all chunks, handle grounding data
20041993
final_answer_text = "".join(answer_chunks)
20051994
if grounding_metadata_list and __event_emitter__:
2006-
# Don't emit replace here; we'll compose final content below
20071995
cited = await self._process_grounding_metadata(
20081996
grounding_metadata_list,
20091997
final_answer_text,
20101998
__event_emitter__,
2011-
emit_replace=False,
20121999
)
20132000
final_answer_text = cited or final_answer_text
20142001

@@ -2386,7 +2373,6 @@ async def get_response():
23862373
grounding_metadata_list,
23872374
final_answer,
23882375
__event_emitter__,
2389-
emit_replace=False,
23902376
)
23912377
final_answer = cited or final_answer
23922378

0 commit comments

Comments
 (0)