Skip to content

Commit 7131114

Browse files
authored
Merge pull request #114 from owndev/copilot/fix-gemini-chatresult-issue
Fix Gemini streaming response not persisted when leaving chat
2 parents 0bc6849 + 8a41287 commit 7131114

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pipelines/google/google_gemini.py

Lines changed: 5 additions & 1 deletion
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.8.3
7+
version: 1.8.4
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.
@@ -2052,6 +2052,10 @@ async def emit_chat_event(event_type: str, data: Dict[str, Any]) -> None:
20522052
{"role": "assistant", "content": final_content, "done": True},
20532053
)
20542054

2055+
# Yield final content to ensure the async iterator completes properly.
2056+
# This ensures the response is persisted even if the user navigates away.
2057+
yield final_content
2058+
20552059
except Exception as e:
20562060
self.log.exception(f"Error during streaming: {e}")
20572061
# Check if it's a chunk size error and provide specific guidance

0 commit comments

Comments
 (0)