CalendarGPT is a Python-based application that allows users to interact with their Google Calendar using natural language commands over text messaging. It leverages the Google Calendar API, Twilio API, and DAGent for managing calendar events.
- View upcoming calendar events
- Create new calendar events with customizable details (summary, start/end time, description, location, attendees)
- Interface with CalendarGPT through phone messaging
To get started with CalendarGPT, follow these steps:
- Clone the repository:
git clone https://github.com/ParthSareen/CalendarGPT.git
- Install the required dependencies:
pip install -r requirements.txt
- Set up the Google Calendar API credentials:
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Calendar API for your project
- Create credentials (OAuth client ID) for a desktop application
- Download the
credentials.json
file and place it in the project directory
- Set up the Twilio API credentials (can skip if running
cli.py
):- Sign up for a Twilio account
- Get your Account SID and Auth Token from the Twilio console
- Set the following environment variables:
TWILIO_ACCOUNT_SID
: Your Twilio Account SIDTWILIO_AUTH_TOKEN
: Your Twilio Auth TokenTWILIO_NUMBER
: Your Twilio phone numberMY_PHONE_NUMBER
: The phone number you want to receive SMS reminders on
- Run the application:
python src/calendar_agent/server.py
CLI version of the application. You can try things out here before using the server. It sets up the decision nodes and function nodes for the agent, handles user input, and manages the interaction flow.
Run with
python3 src/calendar_agent/cli.py
This file contains the core functions for interacting with the Google Calendar API, including:
authorize()
: Handles the OAuth2 authentication flow with Google Calendarget_calendar_events(start_time, end_time)
: Retrieves a list of upcoming events within the specified time rangecreate_calendar_event(summary, start_time, end_time, description, location, attendees)
: Creates a new calendar event with the provided details
This file contains the function for sending SMS reminders using the Twilio API:
send_message(prev_output, *args, **kwargs)
: Sends an SMS message to the configured phone number using the Twilio API
This file sets up a Flask server to handle incoming SMS messages and respond with calendar information. It exposes an endpoint /sms/
that accepts incoming SMS messages and sends a response back with the relevant calendar information.
Contributions to CalendarGPT are welcome! If you find any issues or have ideas for improvements, please open an issue or submit a pull request.
When contributing, please follow the existing code style and conventions. Additionally, make sure to update the documentation accordingly.
CalendarGPT is released under the MIT License.