Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix OpenAI llm return bug (#1728)

黄腾61096596bcbe
diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py
index 3612cc55dd..48dc29ba09 100644
--- a/rag/llm/chat_model.py
+++ b/rag/llm/chat_model.py
@@ -62,6 +62,8 @@ class Base(ABC):
**gen_conf)
for resp in response:
if not resp.choices:continue
+ if not resp.choices[0].delta.content:
+ resp.choices[0].delta.content = ""
ans += resp.choices[0].delta.content
total_tokens = (
(