ADAL(AuthBot)を使用して認証した後、認証後のポストAuthがユーザー入力を受け取り、LUISに送信してインテント/エンティティを収集します。私はSharepoint Online REST APIに送るURIを構築するために返されるものを使用します。ユーザー入力が有効な場合、Sharepointは解析してユーザーに返すJSONを返します。MessageControllerの外で認証後にLUISを呼び出します。
認証後に問題がLUISクラスに入力されています。私は私のMessageControllerからAuthBot ActionDialogを呼び出します。
if (message.Type == "Message")
{
return await Conversation.SendAsync(message,() => new ActionDialog());
}
ActionDialogの中で、私が移動するかどうかはわかりませんLUISクラスにメッセージを移動
public async Task MessageReceivedAsync(IDialogContext context, IAwaitable<Message> item)
{
var message = await item;
if (message.Text == "logon")
{
if (string.IsNullOrEmpty(await context.GetAccessToken(ConfigurationManager.AppSettings["ActiveDirectory.ResourceId"])))
{
await context.Forward(new AzureAuthDialog(ConfigurationManager.AppSettings["ActiveDirectory.ResourceId"]), this.ResumeAfterAuth, message, CancellationToken.None);
}
else
{
context.Wait(MessageReceivedAsync);
}
}
else if (string.IsNullOrEmpty(await context.GetAccessToken(ConfigurationManager.AppSettings["ActiveDirectory.ResourceId"])))
{
await context.Forward(new AzureAuthDialog(ConfigurationManager.AppSettings["ActiveDirectory.ResourceId"]), this.ResumeAfterAuth, message, CancellationToken.None);
}
else
{
//this is where I want to send the next user input from bot to LUIS class.
}
}
LUISクラスが標準であり、次のようになります。
//Define the LuisModel that will be used. The LuisModel JSON file can be found at ~/json/letseat.json
[LuisModel("ModelID", "ModelSecret")]
[Serializable]
public class LuisDialog : LuisDialog<object>
どれでもアイデア?ありがとう。
ありがとうEjadib。私のLUISクラスにMessageReceived行を置くことを意味すると仮定して、正しいですか? –
はい、それは間違いです –
あなたはEjadibをロックします!素晴らしい仕事。ありがとうございました!!!! –