forked from open-webui/open-webui
Merge pull request #1868 from Yanyutin753/rag-dev
📌 fixed a bug where RAG would not reply after not reading the file correctly
This commit is contained in:
commit
3f0fae1d10
1 changed files with 6 additions and 2 deletions
|
@ -321,8 +321,12 @@ def rag_messages(
|
|||
|
||||
context_string = ""
|
||||
for context in relevant_contexts:
|
||||
items = context["documents"][0]
|
||||
try:
|
||||
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()
|
||||
|
||||
ra_content = rag_template(
|
||||
|
|
Loading…
Reference in a new issue