addQuestion()

in frontend/src/app/shared/services/chat.service.ts [75:96]


  addQuestion(question: string, userId: string, agentCase: string, selectedHistory?: any) {
    let newChatMsg: Message = {
      author: 'user',
      message: [],
      user_question: question
    }
    if (agentCase != 'history') {
      this.addToSessionThread(newChatMsg);
    }
    // do API call for agent response.
    switch (agentCase) {
      case 'followup':
        this.generate_sql(question, userId);
        break;
      case 'history':
        this.generate_history_thread(selectedHistory)
        break;
      case 'scenario':
        this.generate_sql(question, userId)
        break;
    }
  }