mirror of
https://github.com/open-webui/open-webui
synced 2025-03-09 22:21:04 +00:00
enh: web embed bypass embedding and retrieval support
This commit is contained in:
parent
5e33955566
commit
d0ddb0637e
@ -414,6 +414,13 @@ def get_sources_from_files(
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
elif file.get("file").get("data"):
|
||||||
|
context = {
|
||||||
|
"documents": [[file.get("file").get("data", {}).get("content")]],
|
||||||
|
"metadatas": [
|
||||||
|
[file.get("file").get("data", {}).get("metadata", {})]
|
||||||
|
],
|
||||||
|
}
|
||||||
else:
|
else:
|
||||||
collection_names = []
|
collection_names = []
|
||||||
if file.get("type") == "collection":
|
if file.get("type") == "collection":
|
||||||
|
@ -1187,9 +1187,13 @@ def process_web(
|
|||||||
content = " ".join([doc.page_content for doc in docs])
|
content = " ".join([doc.page_content for doc in docs])
|
||||||
|
|
||||||
log.debug(f"text_content: {content}")
|
log.debug(f"text_content: {content}")
|
||||||
|
|
||||||
|
if not request.app.state.config.BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL:
|
||||||
save_docs_to_vector_db(
|
save_docs_to_vector_db(
|
||||||
request, docs, collection_name, overwrite=True, user=user
|
request, docs, collection_name, overwrite=True, user=user
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
collection_name = None
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"status": True,
|
"status": True,
|
||||||
@ -1201,6 +1205,7 @@ def process_web(
|
|||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"name": form_data.url,
|
"name": form_data.url,
|
||||||
|
"source": form_data.url,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user