Skip to content
Merged
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
24 changes: 15 additions & 9 deletions plugins/filters/gemini_manifold_companion.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,25 @@ def inlet(self, body: "Body", __metadata__: dict[str, Any]) -> "Body":
if __metadata__["chat_id"] == "local":
# TODO toast notification
log.warning(
"Temporary chats don't have support for native PDF upload currently"
"This chat will likely use Open WebUI's RAG."
"Bypassing Open WebUI's RAG is not possible for temporary chats. "
"The Manifold pipe requires a database entry to access uploaded files, "
"which temporary chats do not have. Falling back to Open WebUI's RAG."
)
metadata_features["upload_documents"] = False
return body
else:
log.info(
"BYPASS_BACKEND_RAG is enabled, bypassing Open WebUI RAG to let the Manifold pipe handle documents."
)
if files := body.get("files"):
log.info(
f"Removing {len(files)} files from the Open WebUI RAG pipeline."
)
body["files"] = []
metadata_features["upload_documents"] = True
else:
log.info(
"BYPASS_BACKEND_RAG is enabled, bypassing Open WebUI RAG and allowing gemini_manifold pipe to handle the rest."
"BYPASS_BACKEND_RAG is disabled. Open WebUI's RAG will be used if applicable."
)
if files := body.get("files"):
log.info(f"Removing {len(files)} from backend's RAG pipeline.")
body["files"] = []
metadata_features["upload_documents"] = True
else:
metadata_features["upload_documents"] = False

# The manifold pipe requires the backend to be in streaming mode to correctly
Expand Down