[Feature Request] How to associate Bing Spell Check Azure key with LUIS Application?
Bot Info
- SDK Platform: NET
- SDK Version: 4.6.1
- Active Channels: Any
- Deployment Environment: Azure App Service
Issue Description
How to associate Bing Spell Check Azure key with Luis Application, Create Cognitive service -Bing spell checker in Azure and In Luis application selected the check box to include big spell checker. In Luis Dialog setting SpellCheck = true for LuisModelAttribute . Where we have to use the Bing Spell Check Azure key or how can use in luis dialog .
You can use LUIS EndPoint API to Get EndPoint Prediction where you can use Bing Spell Check Azure Subscription Key.
The other place to use the Bing Spell Check Azure Subscription Key is to include it the endpoint link which you get it the publish page .
Hope this helps!!
I'm still unclear. I'm declaring my LUIS Dialog with a LuisModel attribute like so in C#:
[LuisModel("my-app-key", "my-api-key", domain: "westeurope.api.cognitive.microsoft.com", spellCheck: true)]
[Serializable]
public class LUISDialog : LuisDialog<RoomReservation>
Where can I add the "bing-spell-check-subscription-key"? The Code Sample at Get EndPoint Prediction doesn't help me here, since it's assuming constructing the query string manually, which I don't since this is all managed behind the scene by the Microsoft.Bot.Builder.Luis.Model.LuisModel and Microsoft.Bot.Builder.Luis.LuisDialog classes. My understanding is that there is no mechanism to permanently associate a SpellCheck key to a LUIS app (even in LUIS UI Test you need to enter it every time) so it must be something I need to specify on my bot programmatically, but how?... Thanks a lot for any pointer you may be able to give me!
Labeled Feature Request: add BingSpellCheckSubscriptionKey to LuisModelAttribute constructor.
Currently, you can so something like this to use a Bing Spell Check Subscription Key with the LuisDialog:
[Serializable]
public class CustomLuisDialog : LuisDialog<object>
{
public CustomLuisDialog()
: base(new LuisService(GetLuisModelAttribute()))
{
}
private static LuisModelAttribute GetLuisModelAttribute()
{
var attribute = new LuisModelAttribute(
"LuisAppId",
"LuisAPIKey");
attribute.BingSpellCheckSubscriptionKey = "BingSpellcheckKey";
return attribute;
}
}
Thanks for this @EricDahlvang. But LuisModelAttribute doesn't define a property called "BingSpellCheckSubscriptionKey"–at least not in Microsoft.Bot.Builder 3.15.3. It might become available in 4.0.0-alpha but the API docs for this upcoming release is not published yet. So the code above doesn't compile for me. What am I missing?
Looking at the code I see there was this enhancement made in January, it was tagged with "[email protected]", but doesn't look like it's made it to the final release. I'm not too familiar with the code, I might be getting this wrong.
in \Microsoft.Bot.Builder.3.15.3\lib\net46\Microsoft.Bot.Builder.dll

Oh yes, sorry got muddled up. Thank you @EricDahlvang
@bommareddysandhya I think this can be closed, am I right? A feature request has been raised to add BingSpellCheckSubscriptionKey to LuisModelAttribute constructor, and the workaround shared by @EricDahlvang above is good enough for the immediate future.
@14geronimo We can leave this open until the feature request is implemented.
@EricDahlvang, when I used your code and implemented it in the production environment, we received an error on the site, I had to use this code:
public BasicLuisDialog() : base(new LuisService(new LuisModelAttribute(
ConfigurationManager.AppSettings["LuisAppId"],
ConfigurationManager.AppSettings["LuisAPIKey"],
domain: ConfigurationManager.AppSettings["LuisAPIHostName"])))
{
}
I also had to use this versions Microsoft.Net.Compiler v1.2.1 and Microsoft.CodeDOM.Providers.DotNetCompilerPlatform v1.0.1
Is any update missing? I must wait?
@procmc What you have looks right. I had left the domain empty (defaulting to west us), but of course you are welcome to provide the value if your LUIS model is hosted at a different data center.
Also, 14geronimo wanted to use the BingSpellCheckSubscriptionKey, so I was providing a method for adding that to the LuisModelAttribute.
@EricDahlvang thank you for responding so fast. Right I want to do the same. I want to use BingSpellCheckSubscriptionKey, but when I do, the azure compiler has errors in the class Microsoft.Net.Compiler
I have no idea why that would be. Can you share an example project that reproduces the problem you're seeing @procmc ?
I use this and work
var attribute = new LuisModelAttribute(
ConfigurationManager.AppSettings["LuisAppId"],
ConfigurationManager.AppSettings["LuisAPIKey"],
domain: ConfigurationManager.AppSettings["LuisAPIHostName"]);
attribute.SpellCheck = true;
attribute.BingSpellCheckSubscriptionKey = ConfigurationManager.AppSettings["BingSpellCheckAPIKey"];
return attribute;
but using this versions Microsoft.Net.Compiler v1.2.1 and Microsoft.CodeDOM.Providers.DotNetCompilerPlatform v1.0.1
@procmc I'd recommend not upgrading the Microsoft.Net.Compiler v1.2.1 and Microsoft.CodeDOM.Providers.DotNetCompilerPlatform v1.0.1 packages if they are causing issues.
As an alternative, I've created a CustomLuisModelAttribute class that you might find useful: -
using Microsoft.Bot.Builder.Luis; using System;
namespace TestBot.Helpers { [Serializable] public class CustomLuisModelAttribute : LuisModelAttribute { public CustomLuisModelAttribute(string modelID, string subscriptionKey, LuisApiVersion apiVersion = LuisApiVersion.V2, string domain = null, double threshold = 0, string bingSpellCheckSubscriptionKey = "", bool spellCheck = false) : base(modelID, subscriptionKey, apiVersion, domain, threshold) { SpellCheck = spellCheck; BingSpellCheckSubscriptionKey = bingSpellCheckSubscriptionKey; } } }
Thank you for opening an issue against the Bot Framework SDK v3. As part of the Bot Framework v4 release, we’ve moved all v3 work to a new repo located at https://github.com/microsoft/botbuilder-v3. We will continue to support and offer maintenance updates to v3 via this new repo.
From now on, https://github.com/microsoft/botbuilder repo will be used as hub, with pointers to all the different SDK languages, tools and samples repos.
As part of this restructuring, we are closing all tickets in this repo.
For defects or feature requests, please create a new issue in the new Bot Framework v3 repo found here: https://github.com/microsoft/botbuilder-v3/issues
For Azure Bot Service Channel specific defects or feature requests (e.g. Facebook, Twilio, Teams, Slack, etc.), please create a new issue in the new Bot Framework Channel repo found here: https://github.com/microsoft/botbuilder-channels/issues
For product behavior, how-to, or general understanding questions, please use Stackoverflow. https://stackoverflow.com/search?q=bot+framework
Thank you.
The Bot Framework Team