Skip to content

Commit

Permalink
fix: SyntaxError: f-string: unmatched '{' error (#1259)
Browse files Browse the repository at this point in the history
  • Loading branch information
dArk10R4 authored Dec 23, 2024
1 parent 85696fb commit 50ad755
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 50ad755

Please sign in to comment.