Skip to content

Commit 5aa7567

Browse files
authored
Merge pull request #110 from nahoj/patch-1
Fix streaming prompt-feedback handling
2 parents b8c5cb8 + b1ae2cf commit 5aa7567

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

pipelines/google/google_gemini.py

Lines changed: 3 additions & 8 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.8.1
7+
version: 1.8.2
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.
@@ -1854,13 +1854,8 @@ async def emit_chat_event(event_type: str, data: Dict[str, Any]) -> None:
18541854
# Check for safety feedback or empty chunks
18551855
if not chunk.candidates:
18561856
# Check prompt feedback
1857-
if (
1858-
response_iterator.prompt_feedback
1859-
and response_iterator.prompt_feedback.block_reason
1860-
):
1861-
block_reason = (
1862-
response_iterator.prompt_feedback.block_reason.name
1863-
)
1857+
if chunk.prompt_feedback and chunk.prompt_feedback.block_reason:
1858+
block_reason = chunk.prompt_feedback.block_reason.name
18641859
message = f"[Blocked due to Prompt Safety: {block_reason}]"
18651860
await emit_chat_event(
18661861
"chat:finish",

0 commit comments

Comments
 (0)