assistant: reply 'images not supported' and skip images
The cog's vision_model defaulted to the text-only llama3.2:3b, so any image in the message/reply was sent to a non-vision model, causing Ollama 400 'invalid image input'. Now the bot tells the user images aren't supported and continues with text-only, preserving normal chat.
This commit is contained in:
@@ -138,6 +138,16 @@ class Assistant(commands.Cog):
|
|||||||
if not content and not image_urls:
|
if not content and not image_urls:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Vision is not supported by the configured text-only model. If the user
|
||||||
|
# sent image(s), tell them once and skip the images, continuing with any
|
||||||
|
# text so normal chat keeps working (avoids Ollama 400 "invalid image
|
||||||
|
# input" from sending images to a non-vision model).
|
||||||
|
if image_urls:
|
||||||
|
await message.reply("Images not supported at this time.")
|
||||||
|
image_urls = []
|
||||||
|
if not content:
|
||||||
|
return
|
||||||
|
|
||||||
if question_mode and not content.rstrip().endswith("?"):
|
if question_mode and not content.rstrip().endswith("?"):
|
||||||
if is_ping:
|
if is_ping:
|
||||||
await message.reply("Question mode is on - messages must end with **?**.")
|
await message.reply("Question mode is on - messages must end with **?**.")
|
||||||
|
|||||||
Reference in New Issue
Block a user