我試圖給我的LUIS提供查詢缺少項目時缺少的信息。例如。如何在Microsoft Bot框架中的LuisDialog中獲取LUIS上下文ID
如果有人說,我想下訂單。爲此,我需要知道有多少用戶。 https://api.projectoxford.ai/luis/v2.0/apps/上的LUIS會自動創建上下文ID,以確保我正在與此查詢進行交談。
當LUIS對話框提示缺失的問題時,我如何才能在Bot框架中獲得或告訴同樣的事情。
這是代碼
[Serializable]
[LuisModel("something", "something")]
public class SimpleLUISDialog : LuisDialog<object>
{
[LuisIntent("GetQuote")]
public async Task GetQuote(IDialogContext context, LuisResult result)
{
PromptDialog.text(context, GetChildNumberAsync, "How many Users will you be adding ?", "Sorry please try again", 2);
}
}
private async Task GetUserNumberAsync(IDialogContext context, IAwaitable<string> result)
{
// send to LUIS again for checking the entity for number of users with Context ID
}
}
這是寫得LUIS對話框API(JSON)
"dialog": {
"prompt": "How many users needed?",
"parameterName": "NumberOfLicenses",
"parameterType": "number",
"contextId": "746024ff-a4eb-4f58-b014-42605a3cb757",
"status": "Question"
}