- Introduction of TRACIE_KO_INTERVIEW_DEFINITION_SPECIALIST
- Re-introduction of EveAIAsset - Make translation services resistent for situation with and without current_event defined. - Ensure first question is asked in eveai_chat_client - Start of version 1.4.0 of TRAICIE_SELECTION_SPECIALIST
This commit is contained in:
@@ -121,6 +121,8 @@ export const ChatApp = {
|
||||
// Load historical messages from server
|
||||
this.loadHistoricalMessages();
|
||||
|
||||
console.log('Nr of messages:', this.allMessages.length);
|
||||
|
||||
// Add welcome message if no history
|
||||
if (this.allMessages.length === 0) {
|
||||
this.addWelcomeMessage();
|
||||
@@ -157,12 +159,52 @@ export const ChatApp = {
|
||||
}
|
||||
},
|
||||
|
||||
addWelcomeMessage() {
|
||||
this.addMessage(
|
||||
'Hallo! Ik ben je AI assistant. Vraag gerust om een formulier zoals "contactformulier" of "bestelformulier"!',
|
||||
'ai',
|
||||
'text'
|
||||
);
|
||||
async addWelcomeMessage() {
|
||||
console.log('Sending initialize message to backend');
|
||||
|
||||
// Toon typing indicator
|
||||
this.isTyping = true;
|
||||
this.isLoading = true;
|
||||
|
||||
try {
|
||||
// Verzamel gegevens voor de API call
|
||||
const apiData = {
|
||||
message: 'Initialize',
|
||||
conversation_id: this.conversationId,
|
||||
user_id: this.userId,
|
||||
language: this.currentLanguage
|
||||
};
|
||||
|
||||
const response = await this.callAPI('/api/send_message', apiData);
|
||||
|
||||
// Verberg typing indicator
|
||||
this.isTyping = false;
|
||||
|
||||
// Voeg AI response toe met task_id voor tracking
|
||||
const aiMessage = this.addMessage(
|
||||
'',
|
||||
'ai',
|
||||
'text'
|
||||
);
|
||||
|
||||
// Voeg task_id toe als beschikbaar
|
||||
if (response.task_id) {
|
||||
console.log('Monitoring Initialize Task ID: ', response.task_id);
|
||||
aiMessage.taskId = response.task_id;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error sending initialize message:', error);
|
||||
this.isTyping = false;
|
||||
|
||||
// Voeg standaard welkomstbericht toe als fallback
|
||||
this.addMessage(
|
||||
'Hallo! Ik ben je AI assistant. Vraag gerust om een formulier zoals "contactformulier" of "bestelformulier"!',
|
||||
'ai',
|
||||
'text'
|
||||
);
|
||||
} finally {
|
||||
this.isLoading = false;
|
||||
}
|
||||
},
|
||||
|
||||
setupEventListeners() {
|
||||
|
||||
Reference in New Issue
Block a user