feat: integrate modern GenAI SDK for image generation and enhance image handling in AI requests

This commit is contained in:
2025-10-04 03:10:04 -05:00
parent e2770f70dc
commit a6c47cca5e
5 changed files with 295 additions and 66 deletions

View File

@@ -104,7 +104,11 @@ async function handleAIReply(message: any) {
const messageMeta = buildMessageMeta(message, emojiResult.names);
// Procesar con el servicio de AI usando memoria persistente
// Verificar si hay imágenes adjuntas
const attachments = Array.from(message.attachments.values());
const hasImages = attachments.length > 0 && aiService.hasImageAttachments(attachments);
// Procesar con el servicio de AI usando memoria persistente y soporte para imágenes
const aiResponse = await aiService.processAIRequestWithMemory(
message.author.id,
message.content,
@@ -114,7 +118,10 @@ async function handleAIReply(message: any) {
message.reference.messageId,
message.client,
'normal',
{ meta: messageMeta }
{
meta: messageMeta + (hasImages ? ` | Tiene ${attachments.length} imagen(es) adjunta(s)` : ''),
attachments: hasImages ? attachments : undefined
}
);
// Reemplazar emojis personalizados