src/main.js
/**
   * Send user message to Assistant. 
   */
Send user message to Assistant.
Send user message to Assistant .
handleKeyPress(event) {
    const { userInput, conversation } = this.state;
    if (event.key === 'Enter') {
      messageCounter += 1;
      conversation.push(
        { id: messageCounter,
          text: userInput,
          owner: 'user'
        }
      );
      this.sendMessage(userInput);
      this.setState({
        conversation: conversation,
        userInput: ''
      });
    }
  }
handleKeyPress ( event ) { const { userInput , conversation } = this . state ; if ( event . key === 'Enter' ) { messageCounter += 1 ; conversation . push ( { id : messageCounter , text : userInput , owner : 'user' } ) ; this . sendMessage ( userInput ) ; this . setState ( { conversation : conversation , userInput : '' } ) ; } }
Send user message to Assistant.
Send user message to Assistant .
// clear out input field