strengthen picture_edit hint: model must use edit for previously shared images

This commit is contained in:
Oleksandr Kozachuk
2026-07-13 16:45:15 +02:00
parent e21c262299
commit 1a6b030444
+5 -1
View File
@@ -177,7 +177,11 @@ class AIResponder(AIResponderBase):
recent_images = self.image_cache.recent(message.channel, 4)
if recent_images:
# the model cannot use picture_edit unless told images exist (IMG-16)
context.append(f"recent images in this channel: {len(recent_images)} (set picture_edit=true to edit/remix the newest)")
context.append(
f"recent images in this channel: {len(recent_images)}. When the user asks to modify, reuse, combine or"
" include a previously shared image, you MUST set picture_edit=true — text-to-image cannot see earlier"
" images; only picture_edit passes them to the image model."
)
return context
def message(self, message: AIMessage, limit: Optional[int] = None) -> List[Dict[str, Any]]: