Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion functions/filters/dynamic_vision_router/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
credits to @iamg30 for v0.1.5-v0.1.7 updates
author_url: https://github.com/open-webui
funding_url: https://github.com/open-webui
version: 0.1.7
version: 0.1.8
required_open_webui_version: 0.3.8
"""

Expand Down Expand Up @@ -84,6 +84,17 @@ async def inlet(
item.get("type") == "image_url" for item in user_message_content
)

# check for all history
if not has_images:
for m in messages:
user_message_content = m.get("content")
if user_message_content is not None and isinstance(
user_message_content, list
):
has_images = any(
item.get("type") == "image_url" for item in user_message_content
)

if has_images:
if self.valves.vision_model_id:
body["model"] = self.valves.vision_model_id
Expand Down