Enable model variables & start working on RAG task

This commit is contained in:
Josako
2024-05-25 20:17:02 +02:00
parent e483d6cf90
commit ce91323dc9
15 changed files with 340 additions and 46 deletions

View File

@@ -114,9 +114,30 @@ class EveAIChatWidget extends HTMLElement {
this.socket.on('bot_response', (data) => {
if (data.tenantId === this.tenantId) {
console.log('Bot response received:', data)
console.log('Task ID received:', data.taskId)
this.addMessage(data.message, 'bot', data.messageId, data.algorithm);
this.checkTaskStatus(data.taskId)
}
});
this.socket.on('task_status', (data) => {
console.log('Task status received:', data)
console.log('Task ID received:', data.taskId)
if (data.status === 'SUCCESS') {
this.addMessage(data.result, 'bot');
} else if (data.status === 'FAILURE') {
this.addMessage('Failed to process message.', 'bot');
} else if (data.status === 'pending') {
console.log('Task is pending')
setTimeout(() => this.checkTaskStatus(data.taskId), 1000); // Poll every second
console.log('New check sent')
}
});
}
checkTaskStatus(taskId) {
this.socket.emit('check_task_status', { task_id: taskId });
}
getTemplate() {