openai: fix image json logging

This commit is contained in:
Aleix Conchillo Flaqué
2024-10-02 11:57:50 -07:00
parent 6db65f4335
commit 0a37caf4b4

View File

@@ -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)