@5minds/node-red-dashboard-2-processcube-chat 0.1.1-develop-cb2322-mf120t2z → 0.1.1-develop-3537a6-mf54lair
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -85,9 +85,22 @@ export default {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
// Process files if present
|
|
88
|
-
if (files.length > 0
|
|
89
|
-
const
|
|
90
|
-
|
|
88
|
+
if (files.length > 0) {
|
|
89
|
+
const processedFiles = await this.processFiles(files);
|
|
90
|
+
|
|
91
|
+
if (newMessages.length > 0) {
|
|
92
|
+
// Add files to existing message
|
|
93
|
+
const lastMessage = newMessages[newMessages.length - 1];
|
|
94
|
+
lastMessage.files = processedFiles;
|
|
95
|
+
} else {
|
|
96
|
+
// Create new message for files only
|
|
97
|
+
newMessages.push({
|
|
98
|
+
role: 'user',
|
|
99
|
+
text: '', // Empty text when only files are sent
|
|
100
|
+
files: processedFiles,
|
|
101
|
+
});
|
|
102
|
+
console.log('lus777', newMessages);
|
|
103
|
+
}
|
|
91
104
|
}
|
|
92
105
|
} else if (body.messages) {
|
|
93
106
|
newMessages = body.messages;
|