Enable model variables & start working on RAG task
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user