diff --git a/solutions/HospitalitySample/Deployment/Resources/LU/en/General.lu b/solutions/HospitalitySample/Deployment/Resources/LU/en/General.lu index 7ede276df9..9b203ed6a2 100644 --- a/solutions/HospitalitySample/Deployment/Resources/LU/en/General.lu +++ b/solutions/HospitalitySample/Deployment/Resources/LU/en/General.lu @@ -1,3 +1,12 @@ +> ! Automatically generated by [LUDown CLI](https://github.com/Microsoft/botbuilder-tools/tree/master/Ludown), Mon Aug 05 2019 12:36:29 GMT-0700 (Pacific Daylight Time) + +> ! Source LUIS JSON file: stdin + +> ! Source QnA TSV file: Not Specified + +> ! Source QnA Alterations file: Not Specified + + > # Intent definitions ## Cancel @@ -158,12 +167,14 @@ - some help - who can help me + ## Logout -- signout - forget me -- sign out -- logout - log out +- logout +- sign out +- signout + ## None - all of them @@ -519,3 +530,7 @@ $PREBUILT:ordinal > # List entities + +> # RegEx entities + + diff --git a/solutions/HospitalitySample/Deployment/Resources/QnA/en/Chitchat.lu b/solutions/HospitalitySample/Deployment/Resources/QnA/en/Chitchat.lu index c4f61ab422..fcc44cbe21 100644 --- a/solutions/HospitalitySample/Deployment/Resources/QnA/en/Chitchat.lu +++ b/solutions/HospitalitySample/Deployment/Resources/QnA/en/Chitchat.lu @@ -1,3 +1,13 @@ +> ! Automatically generated by [LUDown CLI](https://github.com/Microsoft/botbuilder-tools/tree/master/Ludown), Mon Aug 05 2019 12:36:34 GMT-0700 (Pacific Daylight Time) + +> ! Source LUIS JSON file: Not Specified + +> ! Source QnA TSV file: stdin + +> ! Source QnA Alterations file: Not Specified + +> # QnA pairs + > Source: custom editorial ## ? What's your age - Are you young diff --git a/solutions/HospitalitySample/Deployment/Resources/QnA/en/Faq.lu b/solutions/HospitalitySample/Deployment/Resources/QnA/en/Faq.lu index 116c5977c5..24a93d84bd 100644 --- a/solutions/HospitalitySample/Deployment/Resources/QnA/en/Faq.lu +++ b/solutions/HospitalitySample/Deployment/Resources/QnA/en/Faq.lu @@ -1,3 +1,13 @@ +> ! Automatically generated by [LUDown CLI](https://github.com/Microsoft/botbuilder-tools/tree/master/Ludown), Mon Aug 05 2019 12:36:36 GMT-0700 (Pacific Daylight Time) + +> ! Source LUIS JSON file: Not Specified + +> ! Source QnA TSV file: stdin + +> ! Source QnA Alterations file: Not Specified + +> # QnA pairs + > Source: custom editorial ## ? What is a Virtual Assistant @@ -63,4 +73,5 @@ New Virtual Assistants are ready to support both Microsoft Teams and speech-rela ```markdown Raise an issue on the [GitHub repo](https://aka.ms/virtualassistant) -``` \ No newline at end of file +``` + diff --git a/solutions/HospitalitySample/Deployment/Resources/QnA/en/hotel_FAQ.lu b/solutions/HospitalitySample/Deployment/Resources/QnA/en/hotel_FAQ.lu new file mode 100644 index 0000000000..d1f279f78d --- /dev/null +++ b/solutions/HospitalitySample/Deployment/Resources/QnA/en/hotel_FAQ.lu @@ -0,0 +1,308 @@ +> ! Automatically generated by [LUDown CLI](https://github.com/Microsoft/botbuilder-tools/tree/master/Ludown), Tue Aug 06 2019 10:01:24 GMT-0700 (Pacific Daylight Time) + +> ! Source LUIS JSON file: Not Specified + +> ! Source QnA TSV file: stdin + +> ! Source QnA Alterations file: Not Specified + +> # QnA pairs + +> Source: Editorial +## ? Where is the gym? +- Is there a gym? +- Where is the fitness center? +- When is the fitness center open +- What hours is the gym open + +```markdown +Our fitness center is located on the 2nd floor, and is open 24 hours, 7 days a week.  +``` + +> Source: Editorial +## ? When does the bar close? +- When is the bar open? +- What hours is the bar open? + +```markdown +The bar is open from 5:00pm to 10:00pm everyday. +``` + +> Source: Editorial +## ? What's the wifi password? +- Do you have wifi? +- What is the wifi? +- Is there wifi +- How can I get on the internet + +```markdown +The Wi-Fi network name is Hotel_WiFi and the password is hotelsummer2019. +``` + +> Source: Editorial +## ? What amenities does the hotel have?  +- What amenities do you have? +- hotel services and amenities + +```markdown +We provide the following services and amenities: +- All public areas are non-smoking +- Concierge desk +- Hot breakfast +- Laundry on-site, coin operated +- Mobility accessible rooms +- Room service +- Car rental +- Foreign exchange, nearby +- Housekeeping service daily +- Limousine service +- Newspaper in lobby +- Safe deposit boxes +- Valet dry-cleaning +``` + +> Source: Editorial +## ? Where is the printer?  +- Do you have a printer and copier  +- Can I print something +- Can I copy something +- Do you have fax machines +- Can I fax something + +```markdown +There are printers, copiers, and fax machines available in the 24-hour business center on the 1st floor. +``` + +> Source: Editorial +## ? Where is breakfast served?  +- Where is the breakfast restaurant? + +```markdown +Breakfast is served in our restaurant on the 1st floor. +``` + +> Source: Editorial +## ? What time is breakfast?  +- When does the breakfast restaurant open? +- When does breakfast close? + +```markdown +Complimentary breakfast is served from 6:30am to 9:00am Monday through Friday, and from 7:00am to 9:30am on Saturday and Sunday. +``` + +> Source: Editorial +## ? Is there a pool? +- Where is the pool? +- When is the pool open? + +```markdown +We have a seasonal outdoor pool on the 1st floor that is open Monday-Sunday from 7:00am to 11:00pm. +``` + +> Source: Editorial +## ? Is there onsite parking available? +- Do you have parking? +- Can I park at the hotel? +- How much does parking cost? + +```markdown +We have onsite parking available to hotel guests for $14 a day. +``` + +> Source: Editorial +## ? Pool amenities +- Is the pool heated? +- Are there towels at the pool? +- What amenities does the pool have? + +```markdown +The pool is heated and towels are provided. +``` + +> Source: Editorial +## ? What is your address? +- What is the hotel address +- What's the hotel's address + +```markdown +200 110th Avenue NE + Bellevue, Washington 98004 USA +``` + +> Source: Editorial +## ? gym amenities +- What amenities does the gym have? +- What equipment does the gym have? +- What gym equipment is there? + +```markdown +Our 24-hour fitness center has a variety of cardiovascular equipment. Towels, water, and headphones are also provided. +``` + +> Source: Editorial +## ? Do you have a shuttle to the airport? +- Do you provide a shuttle service? +- Can I book a hotel shuttle + +```markdown +I'm sorry, this hotel does not provide a shuttle service. We would be happy to recommend public transportation routes or book you a taxi. +``` + +> Source: Editorial +## ? Can I smoke somewhere +- Is there somewhere I can smoke in the hotel  +- Am I allowed to smoke in my room + +```markdown +This hotel has a smoke-free policy. +``` + +> Source: Editorial +## ? What TV channels are there? +- available television channels +- What TV channels can I watch + +```markdown +We provide cable TV, with many channels including CNN, ESPN, and HBO. +``` + +> Source: Editorial +## ? What's your pet policy +- Do you allow pets +- Are you pet friendly? +- Does this hotel accommodate pets? + +```markdown +We are a pet-friendly hotel. There can be at most 2 pets per room, and there is a $75 cleaning fee per stay. +``` + +> Source: Editorial +## ? Can I get mail sent here? +- Can I have a package shipped to the hotel + +```markdown +Yes! Mail can be dropped off at the front desk. As long as your full name is on the package, we will have it dropped off in your room. +``` + +> Source: Editorial +## ? property details +- how big is the hotel +- how many rooms are there in total +- how much property does the hotel have +- how many floors are there in this hotel + +```markdown +Our hotel has 17 floors, 381 rooms, 3 suites, and 17 meeting rooms. +``` + +> Source: Editorial +## ? Do you have a dry-cleaning service? +- Can I get something dry cleaned +- Is there dry cleaning? +- How can I get my clothes dry cleaned? + +```markdown +For valet dry-cleaning, please fill out the dry-cleaning form in your closet and put your clothing in the provided bag. Same day service is provided if your clothing is dropped off at the front desk before 9:00am. +``` + +> Source: Editorial +## ? Is there housekeeping +- How often is my room cleaned +- When do I get housekeeping services + +```markdown +There is a daily housekeeping service for all rooms. +``` + +> Source: Editorial +## ? Is there public transportation nearby +- Is there a bus stop nearby +- Is there a train station close by +- what public transportation is close + +```markdown +The closest bus station is Bellevue Transit Center, which is 0.2 miles N from the hotel. The closest train station is King Street Station, which is 17 miles E from the hotel. +``` + +> Source: Editorial +## ? Is there a spa? +- Do you have spa services? +- Where is the spa? + +```markdown +We do not have a spa service at this hotel, but we would be happy to recommend spas in the area if you would like. +``` + +> Source: Editorial +## ? Do you have electric car charging stations +- Can I charge my electric car +- Are there electric car charging stations + +```markdown +We have 4 electric car charging stations in our parking lot. +``` + +> Source: Editorial +## ? Do you have laundry services +- Can I do my laundry here +- Are there laundry machines +- Where are there laundry machines + +```markdown +We have on-site coin operated laundry machines on the 2nd floor. We also provide valet dry-cleaning services. +``` + +> Source: Editorial +## ? Do you have newspapers +- Can I get a newspaper + +```markdown +There are complimentary newspapers available in the lobby.  +``` + +> Source: Editorial +## ? Can I exchange currency here +- Will you exchange foreign currency + +```markdown +We do not provide currency exchange services at this hotel, but there is a foreign exchange just down the street. +``` + +> Source: Editorial +## ? When is the restaurant open +- What hours can I go to the restaurant + +```markdown +Our restaurant is open everyday for breakfast, lunch and dinner. +``` + +> Source: Editorial +## ? Can I send packages +- Can I get mail sent from here +- Do you have mail delivery + +```markdown +We offer overnight delivery and pickup services. +``` + +> Source: Editorial +## ? What business services do you have +- Do you have a business center +- Where is the business center + +```markdown +We offer the following services in our 24-hour business center on the 1st floor: +- Copy service +- Fax service, fee +- Messenger service +- Network/Internet printing +``` + +> Source: Editorial +## ? Do you offer fitness classes +- Are there fitness classes here + +```markdown +We do not hold fitness classes at this hotel. +``` + diff --git a/solutions/HospitalitySample/Dialogs/MainDialog.cs b/solutions/HospitalitySample/Dialogs/MainDialog.cs index fea3031500..ad3947ae76 100644 --- a/solutions/HospitalitySample/Dialogs/MainDialog.cs +++ b/solutions/HospitalitySample/Dialogs/MainDialog.cs @@ -176,6 +176,28 @@ public MainDialog( } } } + else if (intent == DispatchLuis.Intent.q_hotel_FAQ) + { + cognitiveModels.QnAServices.TryGetValue("hotel_FAQ", out var qnaService); + + if (qnaService == null) + { + throw new Exception("The specified QnA Maker Service could not be found in your Bot Services configuration."); + } + else + { + var answers = await qnaService.GetAnswersAsync(dc.Context, null, null); + + if (answers != null && answers.Count() > 0) + { + await dc.Context.SendActivityAsync(answers[0].Answer, speak: answers[0].Answer); + } + else + { + await _responder.ReplyWith(dc.Context, MainResponses.ResponseIds.Confused); + } + } + } else { // If dispatch intent does not map to configured models, send "confused" response. diff --git a/solutions/HospitalitySample/Services/DispatchLuis.cs b/solutions/HospitalitySample/Services/DispatchLuis.cs index ba94f9d054..81ce1dfe50 100644 --- a/solutions/HospitalitySample/Services/DispatchLuis.cs +++ b/solutions/HospitalitySample/Services/DispatchLuis.cs @@ -1,5 +1,5 @@ // -// Code generated by LUISGen +// Code generated by LUISGen C:\Users\t-luitof\source\repos\botframework-solutions\solutions\HospitalitySample\Deployment\Resources\Dispatch\en\LunaHospitalityVAen_Dispatch.json -cs Luis.DispatchLuis -o C:\Users\t-luitof\source\repos\botframework-solutions\solutions\HospitalitySample\Services // Tool github: https://github.com/microsoft/botbuilder-tools // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -10,25 +10,41 @@ using Microsoft.Bot.Builder.AI.Luis; namespace Luis { - public partial class DispatchLuis : IRecognizerConvert + public partial class DispatchLuis: IRecognizerConvert { public string Text; public string AlteredText; - public enum Intent - { - l_General, - q_Chitchat, - q_Faq, + public enum Intent { + l_General, + q_Chitchat, + q_Faq, + q_hotel_FAQ, + hospitalitySkill, + restaurantBookingSkill, + newsSkill, + pointOfInterestSkill, + WeatherSkill, None }; public Dictionary Intents; public class _Entities { + // Simple entities + public string[] Item; + public string[] topic; + public string[] site; + public string[] KEYWORD; + public string[] ADDRESS; // Instance public class _Instance { + public InstanceData[] Item; + public InstanceData[] topic; + public InstanceData[] site; + public InstanceData[] KEYWORD; + public InstanceData[] ADDRESS; } [JsonProperty("$instance")] public _Instance _instance; @@ -36,7 +52,7 @@ public class _Instance public _Entities Entities; [JsonExtensionData(ReadData = true, WriteData = true)] - public IDictionary Properties { get; set; } + public IDictionary Properties {get; set; } public void Convert(dynamic result) { diff --git a/solutions/HospitalitySample/Services/GeneralLuis.cs b/solutions/HospitalitySample/Services/GeneralLuis.cs index 5389e22f1d..bb0b784046 100644 --- a/solutions/HospitalitySample/Services/GeneralLuis.cs +++ b/solutions/HospitalitySample/Services/GeneralLuis.cs @@ -10,29 +10,28 @@ using Microsoft.Bot.Builder.AI.Luis; namespace Luis { - public partial class GeneralLuis : IRecognizerConvert + public partial class GeneralLuis: IRecognizerConvert { public string Text; public string AlteredText; - public enum Intent - { - Cancel, - Confirm, - Escalate, - FinishTask, - GoBack, - Help, - Logout, - None, - ReadAloud, - Reject, - Repeat, - SelectAny, - SelectItem, - SelectNone, - ShowNext, - ShowPrevious, - StartOver, + public enum Intent { + Cancel, + Confirm, + Escalate, + FinishTask, + GoBack, + Help, + Logout, + None, + ReadAloud, + Reject, + Repeat, + SelectAny, + SelectItem, + SelectNone, + ShowNext, + ShowPrevious, + StartOver, Stop }; public Dictionary Intents; @@ -59,7 +58,7 @@ public class _Instance public _Entities Entities; [JsonExtensionData(ReadData = true, WriteData = true)] - public IDictionary Properties { get; set; } + public IDictionary Properties {get; set; } public void Convert(dynamic result) { diff --git a/solutions/HospitalitySample/skills.json b/solutions/HospitalitySample/skills.json index 7a73a41bfd..9f24956d26 100644 --- a/solutions/HospitalitySample/skills.json +++ b/solutions/HospitalitySample/skills.json @@ -1,2 +1,302 @@ { + "skills": [ + { + "id": "hospitalitySkill", + "msaAppId": "", + "name": "Hospitality Skill", + "endpoint": "", + "description": "The Hospitality skill provides capabilities that may be needed in a hotel room.", + "authenticationConnections": [], + "actions": [ + { + "id": "hospitalitySkill_checkOut", + "definition": { + "description": "Check out of room", + "slots": [], + "triggers": { + "utteranceSources": [ + { + "locale": "en", + "source": [ + "Hospitality#CheckOut" + ] + } + ] + } + } + }, + { + "id": "hospitalitySkill_extendStay", + "definition": { + "description": "Extend reseravation for current room.", + "slots": [], + "triggers": { + "utteranceSources": [ + { + "locale": "en", + "source": [ + "Hospitality#ExtendStay" + ] + } + ] + } + } + }, + { + "id": "hospitalitySkill_getReservation", + "definition": { + "description": "Get current reservation details.", + "slots": [], + "triggers": { + "utteranceSources": [ + { + "locale": "en", + "source": [ + "Hospitality#GetReservation" + ] + } + ] + } + } + }, + { + "id": "hospitalitySkill_lateCheckOut", + "definition": { + "description": "Change to late check out.", + "slots": [], + "triggers": { + "utteranceSources": [ + { + "locale": "en", + "source": [ + "Hospitality#LateCheckOut" + ] + } + ] + } + } + }, + { + "id": "hospitalitySkill_requestItem", + "definition": { + "description": "Request items to be brought to your room.", + "slots": [], + "triggers": { + "utteranceSources": [ + { + "locale": "en", + "source": [ + "Hospitality#RequestItem" + ] + } + ] + } + } + } + ] + }, + { + "id": "restaurantBookingSkill", + "msaAppId": "", + "name": "Restaurant Booking Skill", + "endpoint": "", + "description": "The Restaurant Booking experimental skill provides an example of Restaurant Booking.", + "iconUrl": "", + "authenticationConnections": [], + "actions": [ + { + "id": "restaurantBookingSkill_booking", + "definition": { + "description": "Restaurant Booking", + "slots": [ + { + "name": "name", + "types": [ + "string" + ] + }, + { + "name": "location", + "types": [ + "string" + ] + } + ], + "triggers": { + "utteranceSources": [ + { + "locale": "en", + "source": [ + "restaurant#Reservation" + ] + } + ] + } + } + } + ] + }, + { + "id": "newsSkill", + "msaAppId": "", + "name": "News Skill", + "endpoint": "", + "description": "The News experimental skill provides simple retrieval of News from Bing Search.", + "iconUrl": "", + "authenticationConnections": [], + "actions": [ + { + "id": "newsSkill_findArticles", + "definition": { + "description": "Find News articles", + "slots": [], + "triggers": { + "utteranceSources": [ + { + "locale": "en", + "source": [ + "news#FindArticles" + ] + } + ] + } + } + } + ] + }, + { + "id": "pointOfInterestSkill", + "msaAppId": "", + "name": "Point Of Interest Skill", + "endpoint": "", + "description": "The Point of Interest skill provides PoI search capabilities leveraging Azure Maps and Foursquare.", + "iconUrl": "", + "authenticationConnections": [], + "actions": [ + { + "id": "poiskill_routeFromXToY", + "definition": { + "description": "Find a route from X to Y", + "slots": [ + { + "name": "location", + "types": [ + "string" + ] + } + ], + "triggers": { + "utteranceSources": [ + { + "locale": "en", + "source": [ + "PointOfInterest#NAVIGATION_ROUTE_FROM_X_TO_Y" + ] + } + ] + } + } + }, + { + "id": "poiskill_cancelRoute", + "definition": { + "description": "Cancel an active route.", + "slots": [ + { + "name": "location", + "types": [ + "string" + ] + } + ], + "triggers": { + "utteranceSources": [ + { + "locale": "en", + "source": [ + "PointOfInterest#NAVIGATION_CANCEL_ROUTE" + ] + } + ] + } + } + }, + { + "id": "poiskill_findPoI", + "definition": { + "description": "Find a point of interest.", + "slots": [ + { + "name": "location", + "types": [ + "string" + ] + } + ], + "triggers": { + "utteranceSources": [ + { + "locale": "en", + "source": [ + "PointOfInterest#NAVIGATION_FIND_POINTOFINTEREST" + ] + } + ] + } + } + }, + { + "id": "poiskill_findParking", + "definition": { + "description": "Find parking", + "slots": [ + { + "name": "location", + "types": [ + "string" + ] + } + ], + "triggers": { + "utteranceSources": [ + { + "locale": "en", + "source": [ + "PointOfInterest#NAVIGATION_FIND_PARKING" + ] + } + ] + } + } + } + ] + }, + { + "id": "WeatherSkill", + "msaAppId": "", + "name": "WeatherSkill", + "endpoint": "", + "description": "", + "authenticationConnections": [], + "actions": [ + { + "id": "WeatherSkill_Sample", + "definition": { + "description": "Sample Skill action with no slots", + "slots": [], + "triggers": { + "utteranceSources": [ + { + "locale": "en", + "source": [ + "WeatherSkill#Sample" + ] + } + ] + } + } + } + ] + } + ] } \ No newline at end of file diff --git a/solutions/HospitalitySample/wwwroot/default.htm b/solutions/HospitalitySample/wwwroot/default.htm index b90135e884..fa9e8d48a5 100644 --- a/solutions/HospitalitySample/wwwroot/default.htm +++ b/solutions/HospitalitySample/wwwroot/default.htm @@ -4,7 +4,7 @@ - Virtual Assistant Template + Hospitality Sample VA