Skip to content

Commit 12588bf

Browse files
committedMay 24, 2023
Added AI Booking Chatbot
1 parent ddb84d4 commit 12588bf

File tree

4 files changed

+1383
-0
lines changed

4 files changed

+1383
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import sys
2+
import smtplib
3+
from email.mime.multipart import MIMEMultipart
4+
from email.mime.text import MIMEText
5+
6+
def main(args):
7+
# set up the SMTP server
8+
s = smtplib.SMTP("smtp.gmail.com", 587)
9+
s.starttls()
10+
s.login("sender email", "sender password") #Replace with your own Gmail ID and Google Account App Password
11+
msg = MIMEMultipart()
12+
msg['From']="sender email" #Replace with your own Gmail ID
13+
msg['To']="receiver email" #Replace with your receiver email ID
14+
msg['Subject']="Booking request"
15+
phone = args.get("phone")
16+
date = args.get("date")
17+
time = args.get("time")
18+
message = f"Hello team, \nThis is your AI Chatbot. We got a room booking request at {date} {time}. Phone number is {phone}. \n\nThanks and Regards,\nyour AI Chatbot."
19+
msg.attach(MIMEText(message, 'plain'))
20+
s.send_message(msg)
21+
return { 'message': 'Email Sent' }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# AI Room Booking Chatbot
2+
3+
## Demo
4+
5+
![AI Room booking chatbot - Demo](demo.gif)
6+
7+
8+
### Instruction
9+
10+
Download or Clone this repo on your local machine
11+
12+
1. Create your IBM Cloud Account at https://cloud.ibm.com/registration If you already have an IBM Cloud Account, login here https://cloud.ibm.com/login
13+
2. Provision your IBM Watson Assistant at https://cloud.ibm.com/catalog/services/watson-assistant Name your IBM Watson Assistant service and Click on create.
14+
3. Click on launch Watson Assitant to open the tool.
15+
4. Then Click on "Create assistant" Button to create your IBM Watson Assistant.
16+
5. Name your assistant. If you want, you can give description for ypur assistant.
17+
6. Click on "Add an actions or dialog skill"
18+
7. Go to "upload skill" tab and choose the [skill-Room-Booking.json](skill-Room-Booking.json)
19+
8. We completed the chatbot. Let's set our IBM Cloud Function to send an email when someone sends a booking request. Go to https://cloud.ibm.com/functions/actions and Click on "Create" Button and click on "Action"
20+
9. Prove a name for your Action. Leave "Enclosing Package" as default. And Choose python 3.7 as your runtime. Then Finally, Click on "Create".
21+
10. You will see a Text area to enter your python code. Just copy the python from [IBM_Cloud_Function.py](IBM_Cloud_Function.py) and past it in the text area of IBM Cloud Funtion.
22+
11. Now go to your Google Account Security at https://myaccount.google.com/security. Enable 2 step verification. Then Go to "App password" under "Signing in to Google".
23+
12. Select "Mail" as app and "Other" as "Other" as device. Enter any name for your custom device. example: IBM Cloud Fumction
24+
13. Copy the app password and back to our IBM Cloud Function. Enter the app password in the python program on 10 line.
25+
14. Click on "Endponits" from the side bar of IBM Cloud Function Action Click on "Enable as Web Action" and Copy the URL.
26+
15. Come Back to your IBM Watson Assistant. Go to "Option > Webhooks" from the side bar of your IBM Watson Assistant. Then past the URL (Note: Add .json at the end of the URL).
27+
28+
That's it. We have successfully developed our AI Room Booking Chatbot.
5.87 MB
Loading

‎AI Room Booking Chatbot [IBM WATSON]/skill-Room-Booking.json

+1,334
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.