Merge branch 'dev' of https://github.com/MaiM-with-u/MaiBot into dev
This commit is contained in:
@@ -82,8 +82,9 @@ def _convert_messages(
|
||||
content: List[Part] = []
|
||||
for item in message.content:
|
||||
if isinstance(item, tuple):
|
||||
image_format = "jpeg" if item[0].lower() == "jpg" else item[0].lower()
|
||||
content.append(
|
||||
Part.from_bytes(data=base64.b64decode(item[1]), mime_type=f"image/{item[0].lower()}")
|
||||
Part.from_bytes(data=base64.b64decode(item[1]), mime_type=f"image/{image_format}")
|
||||
)
|
||||
elif isinstance(item, str):
|
||||
content.append(Part.from_text(text=item))
|
||||
|
||||
Reference in New Issue
Block a user