This commit is contained in:
seb
2026-10-06 11:39:39 +02:00
parent b99e767c57
commit 5eb0f28300
3 changed files with 243 additions and 18 deletions

View File

@@ -557,7 +557,7 @@ export function register(app, basePath = '') {
return res.status(400).json({ error: parsedId.error });
}
const { message, tool_call_id, role, content, answer, name } = req.body ?? {};
const { message, tool_call_id, role, content, answer, name, attachments } = req.body ?? {};
try {
const manager = getOrCreateManager(parsedId.id, {
@@ -577,10 +577,11 @@ export function register(app, basePath = '') {
name,
});
} else {
if (!message) {
const hasAttachments = Array.isArray(attachments) && attachments.length > 0;
if (!message && !content && !hasAttachments) {
return res.status(400).json({ error: 'Message required' });
}
created = await manager.handleUserMessage(req.user.id, { message });
created = await manager.handleUserMessage(req.user.id, { message, attachments, content });
}
emit(`modelconversation-${parsedId.id}`, { companyId: selected.companyId });