Skip to content

Commit c1cdbca

Browse files
owndevCopilot
andcommitted
fix: update version to 1.15.1 and enhance citation handling in source events
Co-authored-by: Copilot <copilot@github.com>
1 parent bead3c7 commit c1cdbca

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

pipelines/google/google_gemini.py

Lines changed: 8 additions & 5 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.15.0
7+
version: 1.15.1
88
required_open_webui_version: 0.9.0
99
license: Apache License 2.0
1010
description: Highly optimized Google Gemini pipeline with advanced image and video generation capabilities, intelligent compression, and streamlined processing workflows.
@@ -2520,12 +2520,15 @@ async def _process_grounding_metadata(
25202520
if metadata.grounding_supports:
25212521
grounding_supports.extend(metadata.grounding_supports)
25222522

2523-
# Add sources to the response
2523+
# Add sources to the response.
2524+
# Emit each source individually via the "source" event type so that
2525+
# citations are persisted by Open WebUI across page refreshes.
2526+
# A "chat:completion" event with a "sources" payload renders citations
2527+
# in the live response but is not stored with the message.
25242528
if grounding_chunks:
25252529
sources = self._format_grounding_chunks_as_sources(grounding_chunks)
2526-
await __event_emitter__(
2527-
{"type": "chat:completion", "data": {"sources": sources}}
2528-
)
2530+
for source in sources:
2531+
await __event_emitter__({"type": "source", "data": source})
25292532

25302533
# Add status specifying google queries used for grounding
25312534
if web_search_queries:

0 commit comments

Comments
 (0)