From 925b13e3374ae2642888476ba50f5cb335371242 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Sun, 1 Jun 2025 12:29:26 -0400 Subject: [PATCH] fix: correctly display non-roman characters --- CHANGELOG.md | 4 ++++ src/pipecat/processors/aggregators/openai_llm_context.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c4940edf..493b0ef54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed an issue with the `OpenAILLMContext` where non-Roman characters were + being incorrectly encoded as Unicode escape sequences. This was a logging + issue and did not impact the actual conversation. + - In `AWSBedrockLLMService`, worked around a possible bug in AWS Bedrock where a `toolConfig` is required if there has been previous tool use in the messages array. This workaround includes a no_op factory function call is diff --git a/src/pipecat/processors/aggregators/openai_llm_context.py b/src/pipecat/processors/aggregators/openai_llm_context.py index 948e3e101..806741c4c 100644 --- a/src/pipecat/processors/aggregators/openai_llm_context.py +++ b/src/pipecat/processors/aggregators/openai_llm_context.py @@ -106,7 +106,7 @@ class OpenAILLMContext: if "mime_type" in msg and msg["mime_type"].startswith("image/"): msg["data"] = "..." msgs.append(msg) - return json.dumps(msgs) + return json.dumps(msgs, ensure_ascii=False) def from_standard_message(self, message): """Convert from OpenAI message format to OpenAI message format (passthrough).