Can't change language in botframework - botframework

I created a bot in botframework (microsoft Azure) connect to a LUIS App. It worked all very well. But in english. The connection between the Bot and LUIS App has been done automatically.
Now I want it to work in German. So I created a new App in luis with de-de culture. Created my german intents. Published it.
I followed the instructions from LUISChatBot. I could retrieve LUIS AppID and Authorizing Key as well as the endpoint of the German LUIS App to add it to my Azure chat bot. And the bot continues to understand only the intents in english!
So I guess the connection doesn't work how it is explained in the instructions above. Even worse : even if I put nothing ( = I remove the ID and Key and let it empty) in LuisAPIkey or LuisAPIId represented in the image of the Azure Chatbot settings, the bot continues to understand the english intents !?!
How can I make it work? I looked in the code of the bot, but I don't find the key appearing there (which makes sense). The only think I found, was in BasicLuisDialog.cs :
public BasicLuisDialog() : base(new LuisService(new LuisModelAttribute(
ConfigurationManager.AppSettings["LuisAppId"],
ConfigurationManager.AppSettings["LuisAPIKey"],
domain: ConfigurationManager.AppSettings["LuisAPIHostName"])))
{
}
Thank you for your time

Half-Answer : I could change the language by changing the region in Azure (west EU) and then also use eu.luis.ai.
But I still don't know why the chatbot continued working when I removed the key and endpoint of LUIS in Azure.

you can use
var english = new Option();
english.Locale = "en-US";
Reference: GitHub
or
In BotSDK v4.0, you can use System.Globalization.CultureInfo("en-US"); to translate your existing language to the language you needed.

Related

How to convert a V4 bot to a Skill?

We are planning to add existing bot which is V4 to our Universal Bot which is in Virtual Assistant template.
For this we have come up with the Skill based approach via which we can add skills to existing VA.
The challenge which we are facing now is that we couldn't find link which was there earlier to convert existing V4 bot to skill (https://microsoft.github.io/botframework-solutions/skills/tutorials/convert-v4-bot/csharp/2-add-packages/).
and the link which there in FAQ section(https://microsoft.github.io/botframework-solutions/help/faq/ ) under "How do I convert an existing v4 Bot to a Bot Framework Skill?" redirects me to a Microsoft page implementing a skill (https://learn.microsoft.com/en-us/azure/bot-service/skill-implement-skill?view=azure-bot-service-4.0&tabs=cs)
The current document has section of migrating Virtual Assistant to Bot framework Skill(Migrate existing Virtual Assistant to Bot Framework Skills GA).
but I cannot find any page in updated document which can guide me to convert existing V4 Bot to skill.
Please help us with the same.
Looks like your problem is solved on GitHub in this issue. For others with a similar issue, here is the explanation.
The link https://learn.microsoft.com/en-us/azure/bot-service/skill-implement-skill?view=azure-bot-service-4.0&tabs=cs described how to implement a skill. If your bot is based on the BotBuilder SDK greater than or equals to 4.7.0, then your bot is automatically a skill. Virtual Assistant that's created based on the Virtual Assistant Template that's greater than or equals to the 0.7 release will be able to connect to a skill without extra work.
Hope this helps.

The bing spell check service does not correct the typos in my web app bot

I am using .Net V3 SDK Azure Bot framework. Integrated a Bing Spell Check API service with my Web App bot and enabled the service in my LUIS model as well. I thought the spell check service will correct the typos once the user ask the question from the bot. I am sure the spell check service works as the number of calls increase each time I test the bot, but how can I get the suggested text from the spell check service? Do I have to code this functionality in the bot code? thanks in advance for any help.
A query that's been corrected by Bing Spell Check gets sent in the LUIS result's alteredQuery property.
In your LUIS dialog, you can access the AlteredQuery property like this:
[LuisIntent("None")]
public async Task NoneIntent(IDialogContext context, LuisResult result)
{
await context.PostAsync($"I think you meant \"{result.AlteredQuery}\"");
}

Cortana Channel Integration to Bot takes to browser after invocation

I created basic Web app bot (LUIS template, SDK v3) using Azure Bot service. I added some intents and entities and have tested that bot works in web chat control.
After that I added Cortana Channel to it. Gave Invocation name as "my desk" and deployed to Cortana.
I made sure my i am logged into Cortana using same MS account as i used to register into bot framework and language and region settings are En-US on my PC as well as Cortana.
I invoke by asking "Hey Cortana, ask my desk get green book". After this, it opens a browser with some search results.
I am unable to understand whats the problem here? How to debug this issue , in which direction? This is a very simple basic bot that Cortana i think is not able to invoke.
Any help greatly appreciated!!
Thanks!
There may be an issue with cookies; even when changing the user. Please confirm that you have changed between MSAs, or specifically, an MSA and AAD account during your development process. If you do change between accounts on the Cortana notebook, you can try clearing Edge (used by Cortana to render) cookies or Cortana data here. https://privacy.microsoft.com/en-us/windows-10-microsoft-edge-and-privacy
Please let me know.

Cortana skills bot invocation name not being discovered after publishing

I added a new Bot i am developing in .net via the Bot Channels Registration option in Azure. I then added a Cortana channel to the bot via the Knowledge Store. Although I can test my Bot using Test in Web Chat, I cannot get Cortana to talk to my Bot. When Cortana does understand my accent she just opens up a web page and my break point in my code is never reached. Looking at the Channels Tab in Azure and clicking on edit for the Cortana channel, I see my invocation name as being My_XYZ and the option to edit this is disabled. However in the knowledge store I can edit the invocation name which I have changed to My ABC (with space).
The bot is currently published to Self for testing and I can see that its ID points to the name of my bot in Azure i.e. some_team.my_xyz
I am using a secure ngrok tunnel on my localhost and this works ok as stated with the chat bot.
Does anyone know if there is a step missing from the docs? (some links in the docs give 404 errors) and why i cannot change the invocation name of my bot in Azure. Also do I need to have the same invocation names in the Bot and the Cortana channel or does Cortana handle this mapping for you.
I see my invocation name as being My_XYZ and the option to edit this is disabled.
I find that if I’m an administrator on the subscription, the Invocation name option is editable.
But if I’m use another account with Owner role, the Invocation name option will be disabled. I’m not sure if it is portal issue, if possible, you can try to report it on Azure portal.
do I need to have the same invocation names in the Bot and the Cortana channel or does Cortana handle this mapping for you.
Based on my experience, we need not to specify same invocation name on Azure Bot portal and Knowledge Store portal.
In my test, I set invocation name with “helloworld” (not same as invocation name on Azure Bot portal “helloworldchat”), I can invoke helloworld as expected.
My problem was solved here on Github https://github.com/Microsoft/BotBuilder/issues/3991
To sum it up, Cortana Skills is currently only available to the US and since I live in the UK I will have to wait until MS decide to release it to the rest of the world. To overcome this you can change the region of your PC to the US. This allows you to test your app. However, note that Cortana does not fully support adaptive cards.
I only hope that Bot development does not go the same way as apps for Windows 10 did and that MS update the desktop and Azure emulators to support the latest development versions of adaptive cards etc quicker than they are and to release Cortana Skills to developers outside the US. I was hoping that the bot framework would use the same model of development and release that .netcore did.

Does a Bot Framework bot need to be registered every time it changes, or only once?

I have created Bot 'MyFirstBOT' where my backend is QnA maker application data. I have given a name to this bot called 'TestJPBOT' and I have enabled the Teams channel for this bot so that we can use this bot on Teams applications. Right now in our organization we are working to register this bot with Microsoft so that we can start using it. I would like to know going forward if I want to make any changes in the bot, like changing its name, profile picture, or something similar, do I need to reregister it every time with Microsoft? Or is there no need?
Per my simple testing using Azure Bot Service env, we don't need register again after change our bots.
Actually, register your bot is populate your bot on Microsoft, equivalent to create a index for your bot I think. You change your bot's profile or code, should not effect the index.

Resources