feat(Chat Trigger Node): Add support for file uploads & harmonize public and development chat (#9802)

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
oleg
2024-07-09 13:45:41 +02:00
committed by GitHub
parent 501bcd80ff
commit df783151b8
32 changed files with 2309 additions and 940 deletions

View File

@@ -24,11 +24,12 @@ export const ChatPlugin: Plugin<ChatOptions> = {
})),
);
async function sendMessage(text: string) {
async function sendMessage(text: string, files: File[] = []) {
const sentMessage: ChatMessage = {
id: uuidv4(),
text,
sender: 'user',
files,
createdAt: new Date().toISOString(),
};
@@ -41,6 +42,7 @@ export const ChatPlugin: Plugin<ChatOptions> = {
const sendMessageResponse = await api.sendMessage(
text,
files,
currentSessionId.value as string,
options,
);