From 3b3c7aa8cc9c84f4c632c128137d5f4b30e59516 Mon Sep 17 00:00:00 2001 From: Akhil Date: Thu, 22 Jan 2026 15:37:44 -0600 Subject: [PATCH] LLMAssistantAggregator: preserve non-ASCII characters in JSON output Add ensure_ascii=False to json.dumps() calls for tool call arguments and function call results to prevent unnecessary unicode escaping. --- src/pipecat/processors/aggregators/llm_response_universal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pipecat/processors/aggregators/llm_response_universal.py b/src/pipecat/processors/aggregators/llm_response_universal.py index 81dbfe844..6690a6e1e 100644 --- a/src/pipecat/processors/aggregators/llm_response_universal.py +++ b/src/pipecat/processors/aggregators/llm_response_universal.py @@ -833,7 +833,7 @@ class LLMAssistantAggregator(LLMContextAggregator): "id": frame.tool_call_id, "function": { "name": frame.function_name, - "arguments": json.dumps(frame.arguments), + "arguments": json.dumps(frame.arguments, ensure_ascii=False), }, "type": "function", } @@ -866,7 +866,7 @@ class LLMAssistantAggregator(LLMContextAggregator): # Update context with the function call result if frame.result: - result = json.dumps(frame.result) + result = json.dumps(frame.result, ensure_ascii=False) self._update_function_call_result(frame.function_name, frame.tool_call_id, result) else: self._update_function_call_result(frame.function_name, frame.tool_call_id, "COMPLETED")