mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 13:40:55 +00:00
📌 fixed a bug where RAG would not reply after not reading the file correctly
This commit is contained in:
parent
5e168e6fef
commit
c0bb32d768
@ -321,8 +321,12 @@ def rag_messages(
|
|||||||
|
|
||||||
context_string = ""
|
context_string = ""
|
||||||
for context in relevant_contexts:
|
for context in relevant_contexts:
|
||||||
items = context["documents"][0]
|
try:
|
||||||
context_string += "\n\n".join(items)
|
if "documents" in context:
|
||||||
|
items = [item for item in context["documents"][0] if item is not None]
|
||||||
|
context_string += "\n\n".join(items)
|
||||||
|
except Exception as e:
|
||||||
|
log.exception(e)
|
||||||
context_string = context_string.strip()
|
context_string = context_string.strip()
|
||||||
|
|
||||||
ra_content = rag_template(
|
ra_content = rag_template(
|
||||||
|
Loading…
Reference in New Issue
Block a user