Fix non streaming RAG problems (#607)

* Fix non-streaming failure in RAG services

* Fix non-streaming failure in API

* Fix agent non-streaming messaging

* Agent messaging unit & contract tests
This commit is contained in:
cybermaggedon 2026-01-12 18:45:52 +00:00 committed by GitHub
parent 30ca1d2e8b
commit 807f6cc4e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 677 additions and 21 deletions

View file

@ -44,13 +44,16 @@ class AgentResponseTranslator(MessageTranslator):
result["end_of_message"] = getattr(obj, "end_of_message", False)
result["end_of_dialog"] = getattr(obj, "end_of_dialog", False)
else:
# Legacy format
# Legacy format (non-streaming)
if obj.answer:
result["answer"] = obj.answer
if obj.thought:
result["thought"] = obj.thought
if obj.observation:
result["observation"] = obj.observation
# Include completion flags for legacy format too
result["end_of_message"] = getattr(obj, "end_of_message", False)
result["end_of_dialog"] = getattr(obj, "end_of_dialog", False)
# Always include error if present
if hasattr(obj, 'error') and obj.error and obj.error.message: