mirror of https://github.com/Mai-with-u/MaiBot.git
Update src/llm_models/model_client/gemini_client.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>pull/1177/head
parent
c59f8de306
commit
52cbaca6c2
|
|
@ -82,9 +82,7 @@ def _convert_messages(
|
||||||
content: List[Part] = []
|
content: List[Part] = []
|
||||||
for item in message.content:
|
for item in message.content:
|
||||||
if isinstance(item, tuple):
|
if isinstance(item, tuple):
|
||||||
image_format = item[0].lower()
|
image_format = "jpeg" if item[0].lower() == "jpg" else item[0].lower()
|
||||||
if image_format == "jpg":
|
|
||||||
image_format = "jpeg"
|
|
||||||
content.append(
|
content.append(
|
||||||
Part.from_bytes(data=base64.b64decode(item[1]), mime_type=f"image/{image_format}")
|
Part.from_bytes(data=base64.b64decode(item[1]), mime_type=f"image/{image_format}")
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue