Search code examples
azurebotframeworkchatbotbot-framework-composer

How can I use dynamic values in a language generation template?


I would like to re-use a given set of "language generation" sentences in bot composer, while filling it with localized values.

See my example execution + LG template, which does not work.

--> the target LG template

${defaultResponse("Yes")}

--> the source LG template

defaultResponse(defaultValue)

I did not understand your input, so I have made a decision for you and answered the question with "${defaultValue}".

Any idea what I do wrong? I do not find something similar in the documentation.


Solution

  • To create bot with different languages, there is a function called Multilingual support. It's introduced in document here: https://learn.microsoft.com/en-us/composer/how-to-use-multiple-language

    The structure looks like as below when you created bot with Chinese and English.

    /coolbot
       coolbot.dialog
       /language-generation
          /en-us
             common.en-us.lg
             coolbot.en-us.lg
          /zh-cn
             common.zh-cn.lg
             coolbot.zh-cn.lg
       /language-understanding
          /en-us
             coolbot.en-us.lu
          /zh-cn
             coolbot.zh-cn.lu