1

I need a chatbot that is able to response to 2 languages - English and German. I created 2 assistants - one in English and one in German.

My users speaks both languages and they talk to chatbot in both languages (e.g. ask 1 question in English and ask the second one in German.

My questions are

  1. since one assistant can only handle one language, what is the best way switch assistant based on the language users use? Also, what to do with session ID after I switch the assistant?
  2. I save information in the context to remember to last intent detected. How can i pass the context variables to the other assistant?
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Belle
  • 11
  • 2

1 Answers1

0

There are two approaches:

  1. Watson Assistant supports pre- and post-message hooks. You can use them to invoke a webhook to determine the language of the user input and if necessary to translate to the skill / assistant languge, e.g., English, and back. You would have a chatbot with the processing in one language.
  2. You have a "wrapper" app that handles the user input and calls into Watson Assistant. Depending on the detected language, it is either the German or English assistant. Because context is returned by the API call if configured, you could manage the context in your wrapper app and pass it on.
data_henrik
  • 16,724
  • 2
  • 28
  • 49
  • Be aware that the context also contains information indicating the current location in the dialog flow. So you would need to be able to keep this in sync across both dialogs. – chughts Mar 08 '21 at 10:25