A chatbot that you can answer any questions about your personal calendar.
The bot uses Google Calendar data downloaded from a separate script, download_calendar.py. Once your calendar is downloaded, you can run the bot.py script for calendar Q & A.
Calendar Bot Demo Slides.pdfcalendar-bot-demo, which contains:
.env includes a GEMINI API key.sample_calendar.json contains sample calendar data for the demo. Downloaded on Tuesday, May 28, 2024. The calendar content is described on slide 9.requirements_demo.txt is a list of python libraries to install to run the code.test_google_calendar_access.py and download_calendar.py. See download_calendar.py for how we downloaded and preprocessed the calendar data saved in sample_calendar.json. You cannot run this code without Google Calendar Access credentials, which have not been provided for you. Instead, we provide the calendar data.bot.py is the script to run the bot. The intent classification code is in intent_classifier.py. The date extraction code is in date_extraction.py and retrieval & vector index code is in retrieval.pycalendar-bot-demopython=3.10 environment and install the requirements:
conda create -n calendar-bot python=3.10
conda activate calendar-bot
pip install -r requirements_demo.txt
python bot.py --verbose 2This chatbot was developed in a python=3.10 environment. The requirements for the demo are in requirements_demo.txt.
conda create -n calendar-bot python=3.10
conda activate calendar-bot
pip install -r requirements_demo.txt
The chatbot uses the Gemini family of LLMs. If you don't have an API KEY to query these models:
GOOGLE_API_KEY=<API_KEY>
The chatbot answers questions about your own personal Google Calendar. This demo focuses on the conversational functionalities, not integration with other services. If you wish to use your own personal calendar data, you need Google Calendar API access. If you are running the demo code and do not care about conversing with the bot using your own calendar data as context, use the sample calendar data in sample_calendar.json.
The file sample_calendar.json contains a calendar that you can use to test the chatbot. This file contains personal data and will be provided with the demo code.
Go to APIs & Servicescredentials.json.python test_google_calendar_access.py. This will read your calendar and print the values of the summary and startTime fields for the next 10 events in the calendar.To download the your calendar data, run he calendar download script with the following command:
python download_calendar.py [options]
Here is an example with recommended arguments:
python download_calendar.py --calendar_path "my_calendar.json" --filter --past --n_events 50
If you did not set up Google Calendar API access to use your personal calendar, skip this step and use the sample data in the sample_calendar.json provided.
Run the script with the following command:
python bot.py [options]
0: Print only the response.1: Print detected intent, number of documents retrieved, and dates extracted.2: Additionally, print details of the retrieved documents.3: Additionally, print processing time.Here is an example:
python bot.py --calendar_path "sample_calendar.json" --use_async --top_n 5 --fields "location,summary,description" --verbose 1
A hand drawn architecture diagram can be found here:

78 commits
Python
100.0%
A chatbot that you can answer any questions about your personal calendar.
The bot uses Google Calendar data downloaded from a separate script, download_calendar.py. Once your calendar is downloaded, you can run the bot.py script for calendar Q & A.
Calendar Bot Demo Slides.pdfcalendar-bot-demo, which contains:
.env includes a GEMINI API key.sample_calendar.json contains sample calendar data for the demo. Downloaded on Tuesday, May 28, 2024. The calendar content is described on slide 9.requirements_demo.txt is a list of python libraries to install to run the code.test_google_calendar_access.py and download_calendar.py. See download_calendar.py for how we downloaded and preprocessed the calendar data saved in sample_calendar.json. You cannot run this code without Google Calendar Access credentials, which have not been provided for you. Instead, we provide the calendar data.bot.py is the script to run the bot. The intent classification code is in intent_classifier.py. The date extraction code is in date_extraction.py and retrieval & vector index code is in retrieval.pycalendar-bot-demopython=3.10 environment and install the requirements:
conda create -n calendar-bot python=3.10
conda activate calendar-bot
pip install -r requirements_demo.txt
python bot.py --verbose 2This chatbot was developed in a python=3.10 environment. The requirements for the demo are in requirements_demo.txt.
conda create -n calendar-bot python=3.10
conda activate calendar-bot
pip install -r requirements_demo.txt
The chatbot uses the Gemini family of LLMs. If you don't have an API KEY to query these models:
GOOGLE_API_KEY=<API_KEY>
The chatbot answers questions about your own personal Google Calendar. This demo focuses on the conversational functionalities, not integration with other services. If you wish to use your own personal calendar data, you need Google Calendar API access. If you are running the demo code and do not care about conversing with the bot using your own calendar data as context, use the sample calendar data in sample_calendar.json.
The file sample_calendar.json contains a calendar that you can use to test the chatbot. This file contains personal data and will be provided with the demo code.
Go to APIs & Servicescredentials.json.python test_google_calendar_access.py. This will read your calendar and print the values of the summary and startTime fields for the next 10 events in the calendar.To download the your calendar data, run he calendar download script with the following command:
python download_calendar.py [options]
Here is an example with recommended arguments:
python download_calendar.py --calendar_path "my_calendar.json" --filter --past --n_events 50
If you did not set up Google Calendar API access to use your personal calendar, skip this step and use the sample data in the sample_calendar.json provided.
Run the script with the following command:
python bot.py [options]
0: Print only the response.1: Print detected intent, number of documents retrieved, and dates extracted.2: Additionally, print details of the retrieved documents.3: Additionally, print processing time.Here is an example:
python bot.py --calendar_path "sample_calendar.json" --use_async --top_n 5 --fields "location,summary,description" --verbose 1
A hand drawn architecture diagram can be found here:

78 commits
Python
100.0%