BOT Work - Kan ikke koble Luis- AI Dialog

stemmer
0

Nedenfor er kildekoden for å kommunisere til LUIS- AI fra min Bot søknad. Når jeg prøver å formidle er jeg alltid får Access Denied respons. Jeg vet ikke hva jeg mangler her.

 [LuisModel(8c9285fb-198a-4f49-8fe4-b08ac5541ac2, 5c47c63887e346c2aee24d1755e07d29)]
    [Serializable]
    public class LUISDialog:LuisDialog<RoomReservation>
    {
        private readonly BuildFormDelegate<RoomReservation> Reservation;

        public LUISDialog(BuildFormDelegate<RoomReservation> reservceRoom)
        {
            this.Reservation = reservceRoom;
        }
        [LuisIntent()]
        [LuisIntent(None)]
        public async Task None(IDialogContext dialogContext, LuisResult luisResult)
        {
            await dialogContext.PostAsync(I am sorry I don't know what you mean );
            dialogContext.Wait(MessageReceived);
        }

        [LuisIntent(Greeting)]
        public async Task Greeting(IDialogContext dialogContext, LuisResult luisResult)
        {
         dialogContext.Call(new GreetingDialog(), CallBack);
        }

        private async Task CallBack(IDialogContext context, IAwaitable<object> result)
        {
            context.Wait(MessageReceived);
        }

        [LuisIntent(Reservation)]
        public async Task RoomReservation(IDialogContext dialogContext, LuisResult luisResult)
        {
            FormDialog<RoomReservation> enrollmentForm =new FormDialog<RoomReservation>(new RoomReservation(),this.Reservation, FormOptions.PromptInStart);
            dialogContext.Call(enrollmentForm, CallBack);
        }

        [LuisIntent(QueryAmenities)]
        public async Task QueryAmenities(IDialogContext dialogContext, LuisResult luisResult)
        {
            foreach (var entity in luisResult.Entities.Where(entity=>entity.Type==Amenity))
            {
                var value = entity.Entity.ToLower();
                if (value == pool || value == gym || value == wifi || value == towels)
                {
                    await dialogContext.PostAsync(Yes we have that);
                    dialogContext.Wait(MessageReceived);
                    return;
                }
                await dialogContext.PostAsync(I'am sorry we don't have that);
                dialogContext.Wait(MessageReceived);
                return;
            }
            await dialogContext.PostAsync(I'am sorry we don't have that);
            dialogContext.Wait(MessageReceived);
        }
    }

Skjermbilde av feil jeg får skriv

Controller kode

[BotAuthentication]
    public class MessagesController : ApiController
    {
        /// <summary>
        /// POST: api/Messages
        /// Receive a message from a user and reply to it
        /// </summary>
        public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
        {
            if (activity.Type == ActivityTypes.Message)
            {
                //ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
                //// calculate something for us to return
                //int length = (activity.Text ?? string.Empty).Length;

                //// return our reply to the user
                //Activity reply = activity.CreateReply($You sent {activity.Text} which was {length} characters);
                //await connector.Conversations.ReplyToActivityAsync(reply);
                // await Conversation.SendAsync(activity, () =>  HotelBotDialog.dialog);
                await Conversation.SendAsync(activity, MakeLuisDialog);
            }
            else
            {
                 await HandleSystemMessage(activity);
            }
            var response = Request.CreateResponse(HttpStatusCode.OK);
            return response;
        }

LUIS Intent

skriv

Vennligst hjelpe meg å løse dette

Publisert på 28/02/2017 klokken 22:22
kilden bruker
På andre språk...                            


2 svar

Svarte 02/03/2017 kl. 18:26
kilden bruker

stemmer
0

Probrably du bruker endepunkt-tasten i stedet den programma Key API. Sjekk dette: skriv bildebeskrivelse her

Svarte 27/06/2017 kl. 18:01
kilden bruker

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more