From 0a37caf4b496dccc33df1afff4892c4dda7254a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Wed, 2 Oct 2024 11:57:50 -0700 Subject: [PATCH] openai: fix image json logging --- src/pipecat/processors/aggregators/openai_llm_context.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pipecat/processors/aggregators/openai_llm_context.py b/src/pipecat/processors/aggregators/openai_llm_context.py index c86045fab..f099c372d 100644 --- a/src/pipecat/processors/aggregators/openai_llm_context.py +++ b/src/pipecat/processors/aggregators/openai_llm_context.py @@ -127,6 +127,8 @@ class OpenAILLMContext: if item["type"] == "image_url": if item["image_url"]["url"].startswith("data:image/"): item["image_url"]["url"] = "data:image/..." + if "mime_type" in msg and msg["mime_type"].startswith("image/"): + msg["data"] = "..." msgs.append(msg) return json.dumps(msgs)