mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
fix stream chat for ollama (#816)
### What problem does this PR solve? #709 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -248,8 +248,8 @@ class OllamaChat(Base):
|
||||
)
|
||||
for resp in response:
|
||||
if resp["done"]:
|
||||
return resp["prompt_eval_count"] + resp["eval_count"]
|
||||
ans = resp["message"]["content"]
|
||||
yield resp.get("prompt_eval_count", 0) + resp.get("eval_count", 0)
|
||||
ans += resp["message"]["content"]
|
||||
yield ans
|
||||
except Exception as e:
|
||||
yield ans + "\n**ERROR**: " + str(e)
|
||||
|
||||
Reference in New Issue
Block a user