u
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user