gpt4 book ai didi

c# - 路易斯异常 : Operation returned an invalid status code 'Forbidden'

转载 作者:行者123 更新时间:2023-12-03 05:01:44 25 4
gpt4 key购买 nike

出现这样的错误。早些时候,只是有时而已。现在,即使是简单的“嗨”,它也给了我这个异常(exception)。

请帮忙。

Exception caught : Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Models.APIErrorException: Operation returned an invalid status code 'Forbidden'




=============================
Exception caught : Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Models.APIErrorException: Operation returned an invalid status code 'Forbidden'
at Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Prediction.ResolveWithHttpMessagesAsync(String appId, String query, Nullable`1 timezoneOffset, Nullable`1 verbose, Nullable`1 staging, Nullable`1 spellCheck, String bingSpellCheckSubscriptionKey, Nullable`1 log, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.PredictionExtensions.ResolveAsync(IPrediction operations, String appId, String query, Nullable`1 timezoneOffset, Nullable`1 verbose, Nullable`1 staging, Nullable`1 spellCheck, String bingSpellCheckSubscriptionKey, Nullable`1 log, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.AI.Luis.LuisRecognizer.RecognizeInternalAsync(ITurnContext turnContext, CancellationToken cancellationToken) in D:\a\1\s\libraries\Microsoft.Bot.Builder.AI.LUIS\LuisRecognizer.cs:line 413
at Microsoft.Bot.Builder.AI.Luis.LuisRecognizer.RecognizeAsync(ITurnContext turnContext, CancellationToken cancellationToken) in D:\a\1\s\libraries\Microsoft.Bot.Builder.AI.LUIS\LuisRecognizer.cs:line 104
at Microsoft.BotBuilderSamples.BasicBot.OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken) in C:\Users\Gokul.Gopinath\Desktop\A-BI\GokulAssistanceEngine-src\BasicBot.cs:line 115
at Microsoft.Bot.Builder.MiddlewareSet.ReceiveActivityWithStatusAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken) in D:\a\1\s\libraries\Microsoft.Bot.Builder\MiddlewareSet.cs:line 55
at Microsoft.Bot.Builder.BotAdapter.RunPipelineAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken) in D:\a\1\s\libraries\Microsoft.Bot.Builder\BotAdapter.cs:line 167

最佳答案

尽管最初的问题不符合 mcve ,使用 LUIS 时有两个与 403 相关的常见陷阱。

创作/订阅 key 错误或没有

使用 LUIS 处理来自 Web 的示例时,您必须从 LUIS 应用提供订阅和创作 key 。在最新的机器人构建器示例中,它通常位于 *.bot 文件中,如下所示 here .

official documentation 中描述了创作键和查询的概念。 .

403 未通话通话量配额

您已达到 LUIS 启动 key 的配额限制。为了永久解决这个问题,请按照我的指导 here .

关于c# - 路易斯异常 : Operation returned an invalid status code 'Forbidden' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55429585/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com