fix: consolidate psql cleanup logic and fix web add with cleanup (#20072)

* sequential

* consolidate logic and fix for web add

* Update WebSearch.svelte

* Update retrieval.py

* Update retrieval.py

* Update WebSearch.svelte
This commit is contained in:
Classic298
2025-12-21 07:14:29 -05:00
committed by GitHub
parent 5077676d33
commit 48ccb1e170
3 changed files with 33 additions and 15 deletions
+2 -1
View File
@@ -87,6 +87,7 @@ from open_webui.retrieval.utils import (
from open_webui.retrieval.vector.utils import filter_metadata
from open_webui.utils.misc import (
calculate_sha256_string,
sanitize_text_for_db,
)
from open_webui.utils.auth import get_admin_user, get_verified_user
@@ -1378,7 +1379,7 @@ def save_docs_to_vector_db(
if len(docs) == 0:
raise ValueError(ERROR_MESSAGES.EMPTY_CONTENT)
texts = [doc.page_content for doc in docs]
texts = [sanitize_text_for_db(doc.page_content) for doc in docs]
metadatas = [
{
**doc.metadata,