Skip to content

Commit

Permalink
feat:autogen scheduler agent was added
Browse files Browse the repository at this point in the history
  • Loading branch information
Prat011 committed Aug 13, 2024
1 parent 6007b12 commit 7b4b1c6
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 1 deletion.
1 change: 0 additions & 1 deletion cookbook/js-example

This file was deleted.

1 change: 1 addition & 0 deletions cookbook/js-example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../js/examples/docs-example/
1 change: 0 additions & 1 deletion cookbook/python-examples

This file was deleted.

1 change: 1 addition & 0 deletions cookbook/python-examples
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../python/examples/
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
OPENAI_API_KEY=KEY
COMPOSIO_API_KEY=KEY
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import re
from datetime import datetime
from composio.client.collections import TriggerEventData
from composio_crewai import Action, ComposioToolSet
from composio_phidata import Action, ComposioToolSet
from phi.assistant.assistant import Assistant
from phi.workflow.workflow import Workflow

Expand Down
30 changes: 30 additions & 0 deletions python/examples/scheduler_agent/scheduler_agent_phidata/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Scheduling Agent Guide

This guide provides detailed steps to create a Scheduler Agent that leverages Composio, PhiData and ChatGPT to schedule your events based on received emails. Ensure you have Python 3.8 or higher installed.

## Steps to Run

**Navigate to the Project Directory:**
Change to the directory where the `setup.sh`, `main.py`, `requirements.txt`, and `README.md` files are located. For example:
```sh
cd path/to/project/directory
```

### 1. Run the Setup File
Make the setup.sh Script Executable (if necessary):
On Linux or macOS, you might need to make the setup.sh script executable:
```shell
chmod +x setup.sh
```
Execute the setup.sh script to set up the environment and install dependencies:
```shell
./setup.sh
```
Now, fill in the `.env` file with your secrets.

### 2. Run the Python Script
```shell
python cookbook/examples/scheduler_agent/main.py
```


Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
composio-phidata
python-dotenv
phidata
39 changes: 39 additions & 0 deletions python/examples/scheduler_agent/scheduler_agent_phidata/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

# Create a virtual environment
echo "Creating virtual environment..."
python3 -m venv ~/.venvs/scheduler_agent

# Activate the virtual environment
echo "Activating virtual environment..."
source ~/.venvs/scheduler_agent/bin/activate

# Install libraries from requirements.txt
echo "Installing libraries from requirements.txt..."
pip install -r requirements.txt

# Login to your account
echo "Login to your Composio acount"
composio login

# Add trello tool
echo "Add google calendar and gmail tool. Finish the flow"
composio add googlecalendar
composio add gmail

echo "Enable trigger"
composio triggers enable gmail_new_gmail_message

# Copy env backup to .env file
if [ -f ".env.example" ]; then
echo "Copying .env.example to .env..."
cp .env.example .env
else
echo "No .env.example file found. Creating a new .env file..."
touch .env
fi

# Prompt user to fill the .env file
echo "Please fill in the .env file with the necessary environment variables."

echo "Setup completed successfully!"

0 comments on commit 7b4b1c6

Please sign in to comment.