Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions plugins/gcal/PR_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Google Calendar Integration with Composio

/claim #1980

## Changes Made

This PR implements continuous synchronization for Google Calendar events using Composio, replacing the previous manual import approach. The key improvements include:

1. **Real-time Calendar Synchronization**: Events are automatically imported to OMI as they are created or updated in Google Calendar
2. **Webhook Integration**: Set up proper webhook handling for real-time updates from Google Calendar
3. **Robust Error Handling**: Added fallback mechanisms and improved error handling throughout the integration
4. **User Experience Improvements**: Updated UI to make continuous synchronization the recommended default option

## Technical Implementation

- Used Composio's API for authentication and event synchronization
- Implemented webhook handlers to process real-time calendar event updates
- Added fallback mechanisms when webhook creation methods aren't available
- Updated documentation to explain the new continuous synchronization feature

## Benefits

- **Faster Integration**: Teams with limited resources can now integrate OMI with Google Calendar without manual imports
- **Always Up-to-date**: Calendar events in OMI are always synchronized with Google Calendar
- **Better User Experience**: Users don't need to manually import events after the initial setup

This implementation addresses the need for a more scalable approach to platform integration, as mentioned in the issue discussion.
97 changes: 97 additions & 0 deletions plugins/gcal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# OMI Google Calendar Integration

This plugin allows you to import your Google Calendar events into OMI as facts, enabling OMI to be aware of your schedule and provide context-aware assistance.

## Features

- OAuth authentication with Google Calendar API
- Select which calendar to import from
- Choose how far back to import events
- Import events as facts into OMI
- **NEW:** Continuous synchronization using Composio (events are automatically imported as they are created or updated)

## Continuous Synchronization

The plugin now supports continuous synchronization of calendar events using Composio. This means:

- New events are automatically imported to OMI as they are created
- Updated events are automatically updated in OMI
- No need for manual imports

To enable continuous synchronization:

1. Check the "Enable continuous synchronization" option when selecting your calendar
2. Your calendar events will be automatically synchronized with OMI

## Setup

### Prerequisites

1. Python 3.6 or higher
2. Flask
3. Google API client libraries

### Installation

1. Install the required dependencies:

```bash
pip install -r requirements.txt
```

2. Configure your environment variables in the `.env` file:

```
# Google OAuth Configuration
GOOGLE_CALENDAR_CLIENT_ID=your_client_id
GOOGLE_CALENDAR_CLIENT_SECRET=your_client_secret
FLASK_SECRET_KEY=your_secret_key

# Composio Configuration (required for continuous synchronization)
COMPOSIO_API_KEY=your_composio_api_key
COMPOSIO_INTEGRATION_ID=your_composio_integration_id
WEBHOOK_BASE_URL=https://your-webhook-url.com
```

To get your Composio API key and integration ID:
1. Sign up at [Composio.dev](https://composio.dev)
2. Create a Google Calendar integration
3. Copy the API key and integration ID to your `.env` file

3. Update the `app.py` file with your OMI App ID and API Key:

```python
APP_ID = "your_omi_app_id"
API_KEY = "your_omi_api_key"
```

### Running the Plugin

1. Start the Flask application:

```bash
python app.py
```

2. Open your browser and navigate to `http://localhost:5001?uid=your_omi_user_id`

## How to Use

1. Click the "Connect Google Calendar" button
2. Authorize OMI to access your Google Calendar
3. Select which calendar you want to import events from
4. Choose how many days back you want to import events from
5. Click "Import Events"

## Technical Details

- The plugin uses OAuth 2.0 for authentication with Google Calendar API
- Events are fetched from the selected calendar and formatted as facts
- Facts are submitted to the OMI API using the provided App ID and API Key
- The plugin uses Flask for the web interface and API endpoints

## Troubleshooting

- If you encounter port conflicts, you can change the port in `app.py` by modifying the line: `app.run(host='0.0.0.0', port=5001, debug=True)`
- If authentication fails, check that your Google Calendar API credentials are correct in the `.env` file
- If events are not being imported, check that your OMI App ID and API Key are correct in `app.py`
Loading