From fed30621a299f4e8980edde24d23af630f16226f Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Tue, 6 Jan 2026 19:48:42 +0000 Subject: [PATCH] Updated streaming tests --- .../trustgraph/messaging/translators/text_completion.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/trustgraph-base/trustgraph/messaging/translators/text_completion.py b/trustgraph-base/trustgraph/messaging/translators/text_completion.py index b4ba4d13..fa3749b5 100644 --- a/trustgraph-base/trustgraph/messaging/translators/text_completion.py +++ b/trustgraph-base/trustgraph/messaging/translators/text_completion.py @@ -28,14 +28,17 @@ class TextCompletionResponseTranslator(MessageTranslator): def from_pulsar(self, obj: TextCompletionResponse) -> Dict[str, Any]: result = {"response": obj.response} - + if obj.in_token: result["in_token"] = obj.in_token if obj.out_token: result["out_token"] = obj.out_token if obj.model: result["model"] = obj.model - + + # Always include end_of_stream flag for streaming support + result["end_of_stream"] = getattr(obj, "end_of_stream", False) + return result def from_response_with_completion(self, obj: TextCompletionResponse) -> Tuple[Dict[str, Any], bool]: