1

I'm currently trying to set up a chat bot using botframework and LUIS.

LUIS has a free account in which 10.000 calls per month are included. When exceeding this limit ones application recieves a "403 Quota Exceeded" error.

At the moment the bot is answering with the error and I would like it to ignore and don't reply when an error is thrown. enter image description here

I'm pretty much using the BotBuilder Sample Code: https://github.com/Microsoft/BotBuilder/tree/master/CSharp/Samples/SimpleEchoBot

Adding a generic try/catch in the MessageController Post action doesn't resolve the issue.

[ResponseType(typeof(void))]
public virtual async Task<HttpResponseMessage> Post([FromBody] Activity activity)
{
    // check if activity is of type message
    if (activity != null && activity.GetActivityType() == ActivityTypes.Message)
    {
        try
        {
            await Conversation.SendAsync(activity, MakeRoot);
        }
        catch (Exception ex)
        {
            System.Diagnostics.Trace.TraceError(ex.Message);
        }
    }
    else
    {
        HandleSystemMessage(activity);
    }
    return new HttpResponseMessage(System.Net.HttpStatusCode.Accepted);
}

internal static IDialog<object> MakeRoot()
{
    return Chain.From(() => new DefaultDialog());
}

DefaultDialog is inheriting the LuisDialog<T> class.

[LuisModel("---", "---", domain: "westeurope.api.cognitive.microsoft.com")]
[Serializable]
public class DefaultDialog : LuisDialog<object>
{
    [LuisIntent("")]
    public async Task None(IDialogContext context, LuisResult result)
    {
        context.Wait(MessageReceived);
    }
    ...
}

The error is thrown, I'm able to catch it but the bot still answers.

Jo David
  • 1,696
  • 2
  • 18
  • 20
  • fyi: apperently my current quota is 1.000 calls. (I've already asked support why). I'm testing the bot in a staging scenario atm. – Jo David Jan 30 '18 at 15:15
  • There is also a limit of 5 calls per second with LUIS when using the free tier. – D4RKCIDE Jan 30 '18 at 17:41
  • @JoDavid how did you find that 1.000 calls limit? And for your last sentence (The error is thrown, I'm able to catch it but the bot still answers), add more details of your implementation if you want us to help to fix it – Nicolas R Jan 31 '18 at 09:47
  • The answer from Jim Lewallen on this question https://stackoverflow.com/questions/48095767/is-luis-limited-for-use brings more details about this possible 1000 calls limit: it may be because of the use of a bootstrap key as it was called during the preview – Nicolas R Jan 31 '18 at 09:54
  • @NicolasR I was using the bootstrap key. I fixed that issue now by adding a LUIS "instance" in Azure and using the keys provided in there. I'll update the question. – Jo David Jan 31 '18 at 12:47

0 Answers0