"test/git@developer.sourcefind.cn:change/sglang.git" did not exist on "76e59088d88f1c79f258c69edc3b887fbcf4ce61"
Unverified Commit 3f0fae1d authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #1868 from Yanyutin753/rag-dev

📌 fixed a bug where RAG would not reply after not reading the file correctly
parents 5e168e6f c0bb32d7
...@@ -321,8 +321,12 @@ def rag_messages( ...@@ -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(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment