🐛 fix(manager.py): prevent base64 encoding of already encoded image data
The code now checks if the image data is already a string before attempting to base64 encode it. This prevents double encoding of the image data.
This commit is contained in:
parent
2bad404c62
commit
9255f66a5d
1 changed files with 2 additions and 0 deletions
|
|
@ -144,6 +144,8 @@ class ChatManager:
|
|||
if isinstance(msg, FileResponse):
|
||||
if msg.data_type == "image":
|
||||
# Base64 encode the image
|
||||
if isinstance(msg.data, str):
|
||||
continue
|
||||
msg.data = pil_to_base64(msg.data)
|
||||
file_responses.append(msg)
|
||||
if msg.type == "start":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue