Skip to content

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

fix ollama issuet push (#486)

KevinHuSh3610e1e5b4ef
diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py
index 7452931ce0..d4a45f00ac 100644
--- a/rag/llm/chat_model.py
+++ b/rag/llm/chat_model.py
@@ -153,7 +153,7 @@ class OllamaChat(Base):
options=options
)
ans = response["message"]["content"].strip()
- return ans, response["eval_count"] + response["prompt_eval_count"]
+ return ans, response["eval_count"] + response.get("prompt_eval_count", 0)
except Exception as e:
return "**ERROR**: " + str(e), 0