public static CalendarLuis GetBaseUpdateMeetingIntent(
     string userInput,
     CalendarLuis.Intent intents  = CalendarLuis.Intent.ChangeCalendarEntry,
     string[] subject             = null,
     string[] fromDate            = null,
     string[] toDate              = null,
     string[] fromTime            = null,
     string[] toTime              = null,
     string[] slotAttribute       = null,
     string[][] slotAttributeName = null,
     string[] moveEarlierTimeSpan = null,
     string[] moveLaterTimeSpan   = null)
 {
     return(GetCalendarIntent(
                userInput,
                intents,
                subject: subject,
                fromDate: fromDate,
                toDate: toDate,
                fromTime: fromTime,
                toTime: toTime,
                slotAttribute: slotAttribute,
                slotAttributeName: slotAttributeName,
                moveEarlierTimeSpan: moveEarlierTimeSpan,
                moveLaterTimeSpan: moveLaterTimeSpan));
 }
示例#2
0
 private CalendarLuis GetBaseFindMeetingIntent(
     string userInput,
     CalendarLuis.Intent intents = CalendarLuis.Intent.FindCalendarEntry,
     string[] fromDate           = null,
     string[] toDate             = null,
     string[] fromTime           = null,
     string[] toTime             = null,
     double[] ordinal            = null,
     double[] number             = null,
     string[] orderReference     = null,
     string[] askParameter       = null,
     string[] subject            = null,
     string[] contactName        = null,
     string[] location           = null)
 {
     return(GetCalendarIntent(
                userInput,
                intents,
                fromDate: fromDate,
                toDate: toDate,
                fromTime: fromTime,
                toTime: toTime,
                ordinal: ordinal,
                number: number,
                orderReference: orderReference,
                askParameter: askParameter,
                subject: subject,
                contactName: contactName,
                location: location));
 }
 private CalendarLuis GetCancelCalendarIntent(
     string userInput,
     CalendarLuis.Intent intents = CalendarLuis.Intent.CancelCalendar,
     string[] subject            = null,
     string[] contactName        = null,
     string[] fromDate           = null,
     string[] toDate             = null,
     string[] fromTime           = null,
     string[] toTime             = null,
     string[] duration           = null,
     string[] meetingRoom        = null,
     string[] building           = null,
     string[] floorNumber        = null,
     string[] location           = null,
     double[] ordinal            = null,
     double[] number             = null)
 {
     return(GetCalendarIntent(
                userInput,
                intents,
                subject: subject,
                contactName: contactName,
                fromDate: fromDate,
                toDate: toDate,
                fromTime: fromTime,
                toTime: toTime,
                duration: duration,
                meetingRoom: meetingRoom,
                building: building,
                floorNumber: floorNumber,
                location: location,
                ordinal: ordinal,
                number: number));
 }
 private CalendarLuis GetBaseCheckAvailableIntent(
     string userInput,
     CalendarLuis.Intent intents = CalendarLuis.Intent.CheckAvailability,
     string[] subject            = null,
     string[] contactName        = null,
     string[] fromDate           = null,
     string[] toDate             = null,
     string[] fromTime           = null,
     string[] toTime             = null,
     string[] duration           = null,
     string[] meetingRoom        = null,
     string[] location           = null)
 {
     return(GetCalendarIntent(
                userInput,
                intents,
                subject: subject,
                contactName: contactName,
                fromDate: fromDate,
                toDate: toDate,
                fromTime: fromTime,
                toTime: toTime,
                duration: duration,
                meetingRoom: meetingRoom,
                location: location));
 }
示例#5
0
        protected static CalendarLuis GetCalendarIntent(
            string userInput             = null,
            CalendarLuis.Intent intents  = CalendarLuis.Intent.None,
            double[] ordinal             = null,
            double[] number              = null,
            string[] subject             = null,
            string[] contactName         = null,
            string[] fromDate            = null,
            string[] toDate              = null,
            string[] fromTime            = null,
            string[] toTime              = null,
            string[] duration            = null,
            string[] meetingRoom         = null,
            string[] location            = null,
            string[] moveEarlierTimeSpan = null,
            string[] moveLaterTimeSpan   = null,
            string[] orderReference      = null,
            string[] askParameter        = null)
        {
            var intent = new CalendarLuis
            {
                Text    = userInput,
                Intents = new Dictionary <CalendarLuis.Intent, IntentScore>()
            };

            intent.Intents.Add(intents, new IntentScore()
            {
                Score = TopIntentScore
            });
            intent.Entities = new CalendarLuis._Entities
            {
                _instance  = new CalendarLuis._Entities._Instance(),
                ordinal    = ordinal,
                number     = number,
                Subject    = subject,
                personName = contactName
            };
            intent.Entities._instance.personName = GetInstanceDatas(userInput, contactName);
            intent.Entities.FromDate             = fromDate;
            intent.Entities._instance.FromDate   = GetInstanceDatas(userInput, fromDate);
            intent.Entities.ToDate                   = toDate;
            intent.Entities._instance.ToDate         = GetInstanceDatas(userInput, toDate);
            intent.Entities.FromTime                 = fromTime;
            intent.Entities._instance.FromTime       = GetInstanceDatas(userInput, fromTime);
            intent.Entities.ToTime                   = toTime;
            intent.Entities._instance.ToTime         = GetInstanceDatas(userInput, toTime);
            intent.Entities.Duration                 = duration;
            intent.Entities.MeetingRoom              = meetingRoom;
            intent.Entities.Location                 = location;
            intent.Entities.MoveEarlierTimeSpan      = moveEarlierTimeSpan;
            intent.Entities.MoveLaterTimeSpan        = moveLaterTimeSpan;
            intent.Entities.OrderReference           = orderReference;
            intent.Entities._instance.OrderReference = GetInstanceDatas(userInput, orderReference);
            return(intent);
        }
        public static bool IsFindEventsDialog(CalendarLuis.Intent intent)
        {
            switch (intent)
            {
            case CalendarLuis.Intent.FindCalendarDetail:
            case CalendarLuis.Intent.FindCalendarEntry:
            case CalendarLuis.Intent.FindCalendarWhen:
            case CalendarLuis.Intent.FindCalendarWhere:
            case CalendarLuis.Intent.FindCalendarWho:
            case CalendarLuis.Intent.FindDuration:
                return(true);

            default:
                return(false);
            }
        }
示例#7
0
 private CalendarLuis GetBaseTimeRemainingIntent(
     string userInput,
     CalendarLuis.Intent intents = CalendarLuis.Intent.TimeRemaining,
     string[] fromDate           = null,
     string[] toDate             = null,
     string[] fromTime           = null,
     string[] toTime             = null,
     string[] orderReference     = null)
 {
     return(GetCalendarIntent(
                userInput,
                intents,
                fromDate: fromDate,
                toDate: toDate,
                fromTime: fromTime,
                toTime: toTime,
                orderReference: orderReference));
 }
示例#8
0
 public static CalendarLuis GetBaseUpdateMeetingIntent(
     string userInput,
     CalendarLuis.Intent intents = CalendarLuis.Intent.ChangeCalendarEntry,
     string[] subject            = null,
     string[] fromDate           = null,
     string[] toDate             = null,
     string[] fromTime           = null,
     string[] toTime             = null)
 {
     return(GetCalendarIntent(
                userInput,
                intents,
                subject: subject,
                fromDate: fromDate,
                toDate: toDate,
                fromTime: fromTime,
                toTime: toTime));
 }
 private CalendarLuis GetBaseConnectToMeetingIntent(
     string userInput,
     CalendarLuis.Intent intents = CalendarLuis.Intent.ConnectToMeeting,
     string[] subject            = null,
     string[] fromDate           = null,
     string[] toDate             = null,
     string[] fromTime           = null,
     string[] toTime             = null,
     string[] orderReference     = null)
 {
     return(GetCalendarIntent(
                userInput,
                intents,
                subject: subject,
                fromDate: fromDate,
                toDate: toDate,
                fromTime: fromTime,
                toTime: toTime,
                orderReference: orderReference));
 }
        public static CalendarLuis.Intent CheckIntentSwitching(CalendarLuis.Intent intent)
        {
            switch (intent)
            {
            case CalendarLuis.Intent.AcceptEventEntry:
            case CalendarLuis.Intent.ChangeCalendarEntry:
            case CalendarLuis.Intent.CheckAvailability:
            case CalendarLuis.Intent.ConnectToMeeting:
            case CalendarLuis.Intent.CreateCalendarEntry:
            case CalendarLuis.Intent.DeleteCalendarEntry:
            case CalendarLuis.Intent.FindCalendarDetail:
            case CalendarLuis.Intent.FindCalendarEntry:
            case CalendarLuis.Intent.FindCalendarWhen:
            case CalendarLuis.Intent.FindCalendarWhere:
            case CalendarLuis.Intent.FindCalendarWho:
            case CalendarLuis.Intent.FindDuration:
            case CalendarLuis.Intent.TimeRemaining:
                return(intent);

            default:
                return(CalendarLuis.Intent.None);
            }
        }
        private async Task <DialogTurnResult> GetIntentSwitchingResult(WaterfallStepContext sc, CalendarLuis.Intent topIntent, CalendarSkillState state)
        {
            var newFlowOptions = new CalendarSkillDialogOptions()
            {
                SubFlowMode = false
            };

            if (topIntent == CalendarLuis.Intent.DeleteCalendarEntry || topIntent == CalendarLuis.Intent.AcceptEventEntry)
            {
                return(await sc.BeginDialogAsync(Actions.ChangeEventStatus));
            }
            else if (topIntent == CalendarLuis.Intent.ChangeCalendarEntry)
            {
                return(await sc.BeginDialogAsync(Actions.UpdateEvent));
            }
            else if (topIntent == CalendarLuis.Intent.CheckAvailability)
            {
                state.Clear();
                return(await sc.ReplaceDialogAsync(nameof(CheckPersonAvailableDialog), newFlowOptions));
            }
            else if (topIntent == CalendarLuis.Intent.ConnectToMeeting)
            {
                return(await sc.BeginDialogAsync(Actions.ConnectToMeeting));
            }
            else if (topIntent == CalendarLuis.Intent.CreateCalendarEntry)
            {
                state.Clear();
                return(await sc.ReplaceDialogAsync(nameof(CreateEventDialog), newFlowOptions));
            }
            else if (topIntent == CalendarLuis.Intent.FindCalendarDetail ||
                     topIntent == CalendarLuis.Intent.FindCalendarEntry ||
                     topIntent == CalendarLuis.Intent.FindCalendarWhen ||
                     topIntent == CalendarLuis.Intent.FindCalendarWhere ||
                     topIntent == CalendarLuis.Intent.FindCalendarWho ||
                     topIntent == CalendarLuis.Intent.FindDuration ||
                     topIntent == CalendarLuis.Intent.FindMeetingRoom)
            {
                state.Clear();
                return(await sc.ReplaceDialogAsync(nameof(ShowEventsDialog), new ShowMeetingsDialogOptions(ShowMeetingsDialogOptions.ShowMeetingReason.FirstShowOverview, newFlowOptions)));
            }
            else if (topIntent == CalendarLuis.Intent.TimeRemaining)
            {
                state.Clear();
                return(await sc.ReplaceDialogAsync(nameof(TimeRemainingDialog), newFlowOptions));
            }

            return(null);
        }