第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

將LUIS與C#Bot框架集成-錯(cuò)誤

將LUIS與C#Bot框架集成-錯(cuò)誤

C#
楊__羊羊 2021-04-27 13:08:46
我正在嘗試將Luis.ai集成到C#機(jī)器人框架中。該代碼運(yùn)行,但是當(dāng)我向機(jī)器人發(fā)送消息時(shí),它顯示此錯(cuò)誤:“很抱歉,我的機(jī)器人代碼出了問題”當(dāng)它根據(jù)使用意圖的條目進(jìn)行回復(fù)時(shí),我只有兩個(gè)意圖“ None”和“ perfil”。這是我的日志:這是我的類Perfil.cs:using Microsoft.Bot.Builder.Dialogs;using Microsoft.Bot.Builder.Luis;using Microsoft.Bot.Builder.Luis.Models;using System;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;using System.Web;namespace SistemaExperto.Dialogs{    [LuisModel(modelID: "e6168727-2f3e-438b-b46a-88449f4ab52f", subscriptionKey: "ed5f1bda20ac42649123b8969d30e1aa")]    [Serializable]    public class Perfil : LuisDialog<string>    {        [LuisIntent("None")]        public async Task None(IDialogContext context, LuisServiceResult result)        {            await context.PostAsync("I'm sorry I don't have that information");            await context.PostAsync("Try again");        }        [LuisIntent("perfil")]        public async Task perfil(IDialogContext context, LuisServiceResult result)        {            await context.PostAsync("My name is Alex");        }    }}
查看完整描述

1 回答

?
蝴蝶不菲

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊

我測試了您提供的代碼,并用我的LUIS應(yīng)用程序modelID&subscriptionKey替換了該代碼,如果該代碼達(dá)到了perfil意圖,則該代碼將按預(yù)期工作。


如果LuisDialog無法根據(jù)收到的消息解析要執(zhí)行的方法(意圖),則會收到異常:


給定的鍵在詞典中不存在。


為了解決這個(gè)問題,我[LuisIntent("")]在None方法之上添加了內(nèi)容。


[LuisModel(modelID: "{your_modelID}", subscriptionKey: "{your_ subscriptionKey}")]

[Serializable]

public class Perfil : LuisDialog<object>

{

    [LuisIntent("")]

    [LuisIntent("None")]

    public async Task None(IDialogContext context, LuisResult result)

    {

        await context.PostAsync("I'm sorry I don't have that information");

        await context.PostAsync("Try again");

    }


    [LuisIntent("perfil")]

    public async Task perfil(IDialogContext context, LuisResult result)

    {

        await context.PostAsync("My name is Alex");

    }


}

測試結(jié)果:


達(dá)成perfil目標(biāo):

http://img1.sycdn.imooc.com//609643f500015a8d08860569.jpg

異常錯(cuò)誤:

http://img1.sycdn.imooc.com//609644020001db9508940571.jpg


查看完整回答
反對 回復(fù) 2021-05-08
  • 1 回答
  • 0 關(guān)注
  • 168 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號