diff --git a/cookbook/js-example b/cookbook/js-example deleted file mode 120000 index ab8b4bc7bf4..00000000000 --- a/cookbook/js-example +++ /dev/null @@ -1 +0,0 @@ -../js/examples/docs-example/ \ No newline at end of file diff --git a/cookbook/js-example b/cookbook/js-example new file mode 100644 index 00000000000..ab8b4bc7bf4 --- /dev/null +++ b/cookbook/js-example @@ -0,0 +1 @@ +../js/examples/docs-example/ \ No newline at end of file diff --git a/cookbook/python-examples b/cookbook/python-examples deleted file mode 120000 index 911dd99e5a0..00000000000 --- a/cookbook/python-examples +++ /dev/null @@ -1 +0,0 @@ -../python/examples/ \ No newline at end of file diff --git a/cookbook/python-examples b/cookbook/python-examples new file mode 100644 index 00000000000..911dd99e5a0 --- /dev/null +++ b/cookbook/python-examples @@ -0,0 +1 @@ +../python/examples/ \ No newline at end of file diff --git a/python/examples/scheduler_agent/scheduler_agent_phidata/.env.example b/python/examples/scheduler_agent/scheduler_agent_phidata/.env.example new file mode 100644 index 00000000000..c54c01f4f09 --- /dev/null +++ b/python/examples/scheduler_agent/scheduler_agent_phidata/.env.example @@ -0,0 +1,2 @@ +OPENAI_API_KEY=KEY +COMPOSIO_API_KEY=KEY \ No newline at end of file diff --git a/python/examples/scheduler_agent/scheduler_agent_phidata/main.py b/python/examples/scheduler_agent/scheduler_agent_phidata/main.py index 85f944fcdf2..d3f073e7749 100644 --- a/python/examples/scheduler_agent/scheduler_agent_phidata/main.py +++ b/python/examples/scheduler_agent/scheduler_agent_phidata/main.py @@ -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 diff --git a/python/examples/scheduler_agent/scheduler_agent_phidata/readme.md b/python/examples/scheduler_agent/scheduler_agent_phidata/readme.md new file mode 100644 index 00000000000..9172e4c668b --- /dev/null +++ b/python/examples/scheduler_agent/scheduler_agent_phidata/readme.md @@ -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 +``` + + diff --git a/python/examples/scheduler_agent/scheduler_agent_phidata/requirements.txt b/python/examples/scheduler_agent/scheduler_agent_phidata/requirements.txt new file mode 100644 index 00000000000..a7945dad63c --- /dev/null +++ b/python/examples/scheduler_agent/scheduler_agent_phidata/requirements.txt @@ -0,0 +1,3 @@ +composio-phidata +python-dotenv +phidata \ No newline at end of file diff --git a/python/examples/scheduler_agent/scheduler_agent_phidata/setup.sh b/python/examples/scheduler_agent/scheduler_agent_phidata/setup.sh new file mode 100644 index 00000000000..b58a330bb53 --- /dev/null +++ b/python/examples/scheduler_agent/scheduler_agent_phidata/setup.sh @@ -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!" \ No newline at end of file