Exemplo n.º 1
0
        private void GenerateShortcutDialogue()
        {
            Boolean isAlwaysAvailable           = true;
            double  inputTimeoutInterval        = double.MaxValue; // No reason to have a timeout here, since the dialogue is _activated_ upon receiving matching input.
            int     inputMaximumRepetitionCount = int.MaxValue;    // No reason to have a repetition count here, for the reason just mentioned.

            Dialogue shortcutDialogue = new Dialogue("ShortcutDialogue", isAlwaysAvailable);

            FriendlyInputItem inputItemShortcutClarify = new FriendlyInputItem("shortcutInput", new List <string> {
                AgentConstants.QUERY_TAG_1, AgentConstants.QUERY_TAG_2
            }, inputTimeoutInterval, inputMaximumRepetitionCount);

            InputAction actionItemTravelClarify = new InputAction(shortcutDialogue.Context, "shortcutProcessing");

            actionItemTravelClarify.PatternList.Add(new Pattern("Set " + AgentConstants.QUERY_TAG_1 + " [as to] " + AgentConstants.QUERY_TAG_2));

            inputItemShortcutClarify.InputAction = actionItemTravelClarify;
            shortcutDialogue.DialogueItemList.Add(inputItemShortcutClarify);


            ShortcutItem shortcutItem = new ShortcutItem("shortcutProcessing", AgentConstants.QUERY_TAG_1, AgentConstants.QUERY_TAG_2, "", "");

            shortcutItem.OutputAction = new OutputAction("", "");


            shortcutDialogue.DialogueItemList.Add(shortcutItem);

            agent.DialogueList.Add(shortcutDialogue);
        }
Exemplo n.º 2
0
        private void GenerateTravelInterestDialogue()
        {
            Boolean isAlwaysAvailable              = true;
            double  inputTimeoutInterval           = double.MaxValue; // No reason to have a timeout here, since the dialogue is _activated_ upon receiving matching input.
            int     inputMaximumRepetitionCount    = int.MaxValue;    // No reason to have a repetition count here, for the reason just mentioned.
            int     maxSecondsWaitingForCompletion = 12;


            Dialogue travelInterestDialogue = new Dialogue("TravelInterestDialogue", isAlwaysAvailable);

            // The user asks a question of the form "What is a <Q>"?
            List <string> queries = new List <string>()
            {
                AgentConstants.QUERY_TAG_4
            };
            FriendlyInputItem inputItemTravel  = new FriendlyInputItem("TrvlI1", queries, inputTimeoutInterval, inputMaximumRepetitionCount);
            InputAction       actionItemTravel = new InputAction(travelInterestDialogue.Context, "TrvlI2");

            actionItemTravel.PatternList.Add(new Pattern("take me to * " + (string)AgentConstants.QUERY_TAG_4 + " * "));
            actionItemTravel.PatternList.Add(new Pattern("take me to * " + (string)AgentConstants.QUERY_TAG_4));
            actionItemTravel.PatternList.Add(new Pattern("find * " + (string)AgentConstants.QUERY_TAG_4 + " * "));
            actionItemTravel.PatternList.Add(new Pattern("find * " + (string)AgentConstants.QUERY_TAG_4));
            actionItemTravel.PatternList.Add(new Pattern("find " + (string)AgentConstants.QUERY_TAG_4));
            actionItemTravel.PatternList.Add(new Pattern("look for  * " + (string)AgentConstants.QUERY_TAG_4));
            actionItemTravel.PatternList.Add(new Pattern("look for  * " + (string)AgentConstants.QUERY_TAG_4));
            inputItemTravel.InputAction = actionItemTravel;
            travelInterestDialogue.DialogueItemList.Add(inputItemTravel);

            OutputItem outputInterestItem = new OutputItem("TrvlI2", AgentConstants.SPEECH_OUTPUT_TAG,
                                                           new List <string>()
            {
            }, false, 1);

            outputInterestItem.OutputAction = new OutputAction(travelInterestDialogue.Context, "TrvlI3");         //get missing frame state
            outputInterestItem.OutputAction.PatternList.Add(new Pattern("Okay, can you give me your location?"));
            outputInterestItem.OutputAction.PatternList.Add(new Pattern("Will do. I'll just need your  position first, can you tell me?"));
            travelInterestDialogue.DialogueItemList.Add(outputInterestItem);

            FriendlyInputItem inputInterestItemTravelClarify = new FriendlyInputItem("TrvlI3", new List <string> {
                AgentConstants.QUERY_TAG_3
            }, inputTimeoutInterval, inputMaximumRepetitionCount);
            InputAction actionInterestItemTravelClarify = new InputAction(travelInterestDialogue.Context, "TravelInterestIntermediate");

            actionInterestItemTravelClarify.PatternList.Add(new Pattern("[around from at] " + AgentConstants.QUERY_TAG_3));
            actionInterestItemTravelClarify.PatternList.Add(new Pattern("i'm at" + AgentConstants.QUERY_TAG_3));  //Q2 handles destinations
            actionInterestItemTravelClarify.PatternList.Add(new Pattern("i am at" + AgentConstants.QUERY_TAG_3)); //Q2 handles destinations
            actionInterestItemTravelClarify.PatternList.Add(new Pattern("[no nevermind cancel nope]"));
            inputInterestItemTravelClarify.InputAction = actionInterestItemTravelClarify;
            travelInterestDialogue.DialogueItemList.Add(inputInterestItemTravelClarify);

            TravelInterestItem travelVertify = new TravelInterestItem("TravelInterestIntermediate", "", "");

            travelVertify.OutputAction = new OutputAction(travelInterestDialogue.Context, "TravelInterestPlanningComplete1");
            travelVertify.OutputAction.PatternList.Add(new Pattern(""));
            travelInterestDialogue.DialogueItemList.Add(travelVertify);

            TravelPlanningComplete interestCompleteItem = new TravelPlanningComplete("TravelInterestPlanningComplete1", "TravelComplete1", "TravelInterestComplete1", "", mapControl1);

            interestCompleteItem.OutputAction = new OutputAction(travelInterestDialogue.Context, "TravelInterestComplete1");
            travelInterestDialogue.DialogueItemList.Add(interestCompleteItem);

            TravelSearchingCompleteItem waitInterestTravelItem = new TravelSearchingCompleteItem("TravelInterestComplete1", "TravelLoop", maxSecondsWaitingForCompletion, mapControl1);

            waitInterestTravelItem.OutputAction = new OutputAction(travelInterestDialogue.Context, "TravelLoop");
            travelInterestDialogue.DialogueItemList.Add(waitInterestTravelItem);


            TravelInterestChooserItem chooserItem = new TravelInterestChooserItem("TravelLoop", travelInterestDialogue.Context, "", mapControl1);

            chooserItem.inputNoAction = new InputAction("", "");
            chooserItem.inputNoAction.PatternList.Add(new Pattern("no"));
            chooserItem.inputYesAction = new InputAction(travelInterestDialogue.Context, "TravelInterestPlanningComplete1");
            chooserItem.inputYesAction.PatternList.Add(new Pattern("yes"));
            chooserItem.inputBackAction = new InputAction(travelInterestDialogue.Context, "TravelLoop");
            chooserItem.inputBackAction.PatternList.Add(new Pattern("back"));
            chooserItem.inputNextAction = new InputAction(travelInterestDialogue.Context, "TravelLoop");
            chooserItem.inputNextAction.PatternList.Add(new Pattern("next"));
            travelInterestDialogue.DialogueItemList.Add(chooserItem);
            agent.DialogueList.Add(travelInterestDialogue);
        }
Exemplo n.º 3
0
        private void GenerateTravelDialogue()
        {
            string QUERY_TAG_6 = "<Q6>";

            Boolean isAlwaysAvailable              = true;
            double  inputTimeoutInterval           = double.MaxValue; // No reason to have a timeout here, since the dialogue is _activated_ upon receiving matching input.
            int     inputMaximumRepetitionCount    = int.MaxValue;    // No reason to have a repetition count here, for the reason just mentioned.
            int     maxSecondsWaitingForCompletion = 12;


            Dialogue travelDialogue = new Dialogue("TravelDialogue", isAlwaysAvailable);

            // The user asks a question of the form "What is a <Q>"?
            List <string> queries = new List <string>()
            {
                AgentConstants.QUERY_TAG_1, AgentConstants.QUERY_TAG_2, AgentConstants.QUERY_TAG_3, AgentConstants.QUERY_TAG_4, AgentConstants.QUERY_TAG_5, QUERY_TAG_6
            };
            FriendlyInputItem inputItemTravel  = new FriendlyInputItem("TrvlD1", queries, inputTimeoutInterval, inputMaximumRepetitionCount);
            InputAction       actionItemTravel = new InputAction(travelDialogue.Context, "TrvlD2");

            actionItemTravel.PatternList.Add(new Pattern("[get take] me " + (string)AgentConstants.QUERY_TAG_1 + " " + (string)AgentConstants.QUERY_TAG_2 + " " + (string)AgentConstants.QUERY_TAG_3 + " " + (string)AgentConstants.QUERY_TAG_4 + " " + (string)AgentConstants.QUERY_TAG_5 + " " + (string)QUERY_TAG_6));
            actionItemTravel.PatternList.Add(new Pattern("travel " + (string)AgentConstants.QUERY_TAG_1 + " " + (string)AgentConstants.QUERY_TAG_2 + " " + (string)AgentConstants.QUERY_TAG_3 + " " + (string)AgentConstants.QUERY_TAG_4 + " " + (string)AgentConstants.QUERY_TAG_5 + " " + (string)QUERY_TAG_6));
            actionItemTravel.PatternList.Add(new Pattern("[get take] me " + (string)AgentConstants.QUERY_TAG_1 + " " + (string)AgentConstants.QUERY_TAG_2 + " " + (string)AgentConstants.QUERY_TAG_3 + " " + (string)AgentConstants.QUERY_TAG_4));
            actionItemTravel.PatternList.Add(new Pattern("travel " + (string)AgentConstants.QUERY_TAG_1 + " " + (string)AgentConstants.QUERY_TAG_2 + " " + (string)AgentConstants.QUERY_TAG_3 + " " + (string)AgentConstants.QUERY_TAG_4));
            actionItemTravel.PatternList.Add(new Pattern("travel " + (string)AgentConstants.QUERY_TAG_1 + " " + (string)AgentConstants.QUERY_TAG_2));
            actionItemTravel.PatternList.Add(new Pattern("[get take] me " + (string)AgentConstants.QUERY_TAG_1 + " " + (string)AgentConstants.QUERY_TAG_2));

            inputItemTravel.InputAction = actionItemTravel;
            travelDialogue.DialogueItemList.Add(inputItemTravel);


            // The agent searches its long-term memory for (the description of) an object (tag = object) with the required name

            // If the information cannot be found in long-term memory
            TravelItem travelItem = new TravelItem("TrvlD2", queries, "TravelPartialFail1", "");

            //OutputItem itemTrvlD = new OutputItem("TrvlD2", AgentConstants.SPEECH_OUTPUT_TAG, null, false, 1);
            travelItem.OutputAction = new OutputAction(travelDialogue.Context, "TravelPlanningComplete1");
            travelItem.OutputAction.PatternList.Add(new Pattern("Serching "));
            travelItem.OutputAction.PatternList.Add(new Pattern("Checking "));
            travelDialogue.DialogueItemList.Add(travelItem);

            FriendlyInputItem inputItemTravelClarify = new FriendlyInputItem("TravelPartialFail1", new List <string> {
                AgentConstants.QUERY_TAG_1, AgentConstants.QUERY_TAG_2
            }, inputTimeoutInterval, inputMaximumRepetitionCount);
            InputAction actionItemTravelClarify = new InputAction(travelDialogue.Context, "TravelPartialFail2");

            actionItemTravelClarify.PatternList.Add(new Pattern("from " + AgentConstants.QUERY_TAG_1));
            actionItemTravelClarify.PatternList.Add(new Pattern("to " + AgentConstants.QUERY_TAG_2)); //Q2 handles destinations
            actionItemTravelClarify.PatternList.Add(new Pattern("no"));
            inputItemTravelClarify.InputAction = actionItemTravelClarify;
            travelDialogue.DialogueItemList.Add(inputItemTravelClarify);


            TravelFilterItem inputFilterItem = new TravelFilterItem("TravelPartialFail2", "TravelPartialFail1", "", "");

            inputFilterItem.OutputAction = new OutputAction(travelDialogue.Context, "TravelPlanningComplete1"); //abandon when dune
            inputFilterItem.OutputAction.PatternList.Add(new Pattern("I found a destination "));
            inputFilterItem.OutputAction.PatternList.Add(new Pattern("I would recommend the "));

            travelDialogue.DialogueItemList.Add(inputFilterItem);

            TravelPlanningComplete inputCompleteItem = new TravelPlanningComplete("TravelPlanningComplete1", "TravelComplete1", "TravelInterestComplete1", "", mapControl1);

            inputCompleteItem.OutputAction = new OutputAction(travelDialogue.Context, "TravelComplete1");
            travelDialogue.DialogueItemList.Add(inputCompleteItem);

            TravelSearchingCompleteItem waitTravelItem = new TravelSearchingCompleteItem("TravelComplete1", "", maxSecondsWaitingForCompletion, mapControl1);

            waitTravelItem.OutputAction = new OutputAction("", "");
            travelDialogue.DialogueItemList.Add(waitTravelItem);

            agent.DialogueList.Add(travelDialogue);
        }