From 50ad755afed2725b09242c02dba5741755125302 Mon Sep 17 00:00:00 2001 From: dArk10R4 <106441625+dArk10R4@users.noreply.github.com> Date: Mon, 23 Dec 2024 07:46:29 +0400 Subject: [PATCH] fix: SyntaxError: f-string: unmatched '{' error (#1259) --- .../src/assistant_stream/serialization/data_stream.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/assistant-stream/src/assistant_stream/serialization/data_stream.py b/python/assistant-stream/src/assistant_stream/serialization/data_stream.py index aa334c1e78..78d4f83969 100644 --- a/python/assistant-stream/src/assistant_stream/serialization/data_stream.py +++ b/python/assistant-stream/src/assistant_stream/serialization/data_stream.py @@ -15,11 +15,11 @@ def encode_chunk(self, chunk: AssistantStreamChunk) -> str: if chunk.type == "text-delta": return f"0:{json.dumps(chunk.text_delta)}\n" elif chunk.type == "tool-call-begin": - return f"b:{json.dumps({ "toolCallId": chunk.tool_call_id, "toolName": chunk.tool_name })}\n" + return f'b:{json.dumps({ "toolCallId": chunk.tool_call_id, "toolName": chunk.tool_name })}\n' elif chunk.type == "tool-call-delta": - return f"c:{json.dumps({ "toolCallId": chunk.tool_call_id, "argsTextDelta": chunk.args_text_delta })}\n" + return f'c:{json.dumps({ "toolCallId": chunk.tool_call_id, "argsTextDelta": chunk.args_text_delta })}\n' elif chunk.type == "tool-result": - return f"a:{json.dumps({ "toolCallId": chunk.tool_call_id, "result": chunk.result })}\n" + return f'a:{json.dumps({ "toolCallId": chunk.tool_call_id, "result": chunk.result })}\n' pass def get_media_type(self) -> str: