fix: Update attachment handling to use types.Part constructor for URI parts
This commit is contained in:
parent
145c91c5c2
commit
8f578cfe03
@ -932,7 +932,7 @@ async def get_ai_response(cog: 'GurtCog', message: discord.Message, model_name:
|
||||
try:
|
||||
# Add the URI part with a cleaned MIME type
|
||||
clean_mime_type = detected_mime_type.split(';')[0] if detected_mime_type else "application/octet-stream"
|
||||
attachment_parts_to_add.append(types.Part.from_uri(file_url, clean_mime_type))
|
||||
attachment_parts_to_add.append(types.Part(uri=file_url, mime_type=clean_mime_type))
|
||||
print(f"Added URI part for supported attachment: {filename} ({clean_mime_type}) using URL: {file_url}")
|
||||
except Exception as e:
|
||||
print(f"Error creating URI types.Part for attachment {filename} ({detected_mime_type}): {e}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user