mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-23 20:21:03 +02:00
Updated streaming tests
This commit is contained in:
parent
b34c29ad15
commit
fed30621a2
1 changed files with 5 additions and 2 deletions
|
|
@ -28,14 +28,17 @@ class TextCompletionResponseTranslator(MessageTranslator):
|
||||||
|
|
||||||
def from_pulsar(self, obj: TextCompletionResponse) -> Dict[str, Any]:
|
def from_pulsar(self, obj: TextCompletionResponse) -> Dict[str, Any]:
|
||||||
result = {"response": obj.response}
|
result = {"response": obj.response}
|
||||||
|
|
||||||
if obj.in_token:
|
if obj.in_token:
|
||||||
result["in_token"] = obj.in_token
|
result["in_token"] = obj.in_token
|
||||||
if obj.out_token:
|
if obj.out_token:
|
||||||
result["out_token"] = obj.out_token
|
result["out_token"] = obj.out_token
|
||||||
if obj.model:
|
if obj.model:
|
||||||
result["model"] = 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
|
return result
|
||||||
|
|
||||||
def from_response_with_completion(self, obj: TextCompletionResponse) -> Tuple[Dict[str, Any], bool]:
|
def from_response_with_completion(self, obj: TextCompletionResponse) -> Tuple[Dict[str, Any], bool]:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue