feat: basic image upload to AI model (still no context window)

This commit is contained in:
2025-04-14 17:53:21 +02:00
parent 8fe40326b7
commit 727d717b60
3 changed files with 43 additions and 4 deletions

View File

@@ -317,7 +317,19 @@ async def handle_message(message, bot):
staff_role = message.guild.get_role(STAFF_ROLE_ID)
member = message.guild.get_member(message.author.id)
if staff_role in member.roles:
await forward_to_google_api(message)
image_object = None
for attachment in message.attachments:
if attachment.filename.lower().endswith(
".jpg"
) or attachment.filename.lower().endswith(".jpeg"):
image_object = (attachment.url, "image/jpeg")
break
elif attachment.filename.lower().endswith(".png"):
image_object = (attachment.url, "image/png")
break
await forward_to_google_api(message, image_object)
return
# Too many mentions