From 508fbd49e98e3bfbed7202f9461d769d4cbc91fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moura?= Date: Mon, 1 Jul 2024 18:28:11 -0700 Subject: [PATCH] preparing new version --- docs/tools/ComposioTool.md | 72 +++++++++++++++++++++++++ poetry.lock | 45 ++++++++-------- pyproject.toml | 6 +-- src/crewai/cli/templates/pyproject.toml | 2 +- 4 files changed, 98 insertions(+), 27 deletions(-) create mode 100644 docs/tools/ComposioTool.md diff --git a/docs/tools/ComposioTool.md b/docs/tools/ComposioTool.md new file mode 100644 index 000000000..eeb233be5 --- /dev/null +++ b/docs/tools/ComposioTool.md @@ -0,0 +1,72 @@ +# ComposioTool Documentation + +## Description + +This tools is a wrapper around the composio toolset and gives your agent access to a wide variety of tools from the composio SDK. + +## Installation + +To incorporate this tool into your project, follow the installation instructions below: + +```shell +pip install composio-core +pip install 'crewai[tools]' +``` + +after the installation is complete, either run `composio login` or export your composio API key as `COMPOSIO_API_KEY`. + +## Example + +The following example demonstrates how to initialize the tool and execute a github action: + +1. Initialize toolset + +```python +from composio import App +from crewai_tools import ComposioTool +from crewai import Agent, Task + + +tools = [ComposioTool.from_action(action=Action.GITHUB_ACTIVITY_STAR_REPO_FOR_AUTHENTICATED_USER)] +``` + +If you don't know what action you want to use, use `from_app` and `tags` filter to get relevant actions + +```python +tools = ComposioTool.from_app(App.GITHUB, tags=["important"]) +``` + +or use `use_case` to search relevant actions + +```python +tools = ComposioTool.from_app(App.GITHUB, use_case="Star a github repository") +``` + +2. Define agent + +```python +crewai_agent = Agent( + role="Github Agent", + goal="You take action on Github using Github APIs", + backstory=( + "You are AI agent that is responsible for taking actions on Github " + "on users behalf. You need to take action on Github using Github APIs" + ), + verbose=True, + tools=tools, +) +``` + +3. Execute task + +```python +task = Task( + description="Star a repo ComposioHQ/composio on GitHub", + agent=crewai_agent, + expected_output="if the star happened", +) + +task.execute() +``` + +* More detailed list of tools can be found [here](https://app.composio.dev) diff --git a/poetry.lock b/poetry.lock index a9bbb26c1..f75da2851 100644 --- a/poetry.lock +++ b/poetry.lock @@ -820,31 +820,30 @@ files = [ [[package]] name = "crewai-tools" -version = "0.4.3" +version = "0.4.5" description = "Set of tools for the crewAI framework" optional = false -python-versions = ">=3.10,<=3.13" -files = [] -develop = false +python-versions = "<=3.13,>=3.10" +files = [ + {file = "crewai_tools-0.4.5-py3-none-any.whl", hash = "sha256:d970a152a69d039eb23150755d4dc9e7c6ef9176b19a80348142619518e39b17"}, + {file = "crewai_tools-0.4.5.tar.gz", hash = "sha256:1d7763f20afd95c6be70d31f9f0e9334cb42be127c17feddce368907077a6543"}, +] [package.dependencies] -beautifulsoup4 = "^4.12.3" -chromadb = "^0.4.22" -docker = "^7.1.0" -docx2txt = "^0.8" -lancedb = "^0.5.4" +beautifulsoup4 = ">=4.12.3,<5.0.0" +chromadb = ">=0.4.22,<0.5.0" +docker = ">=7.1.0,<8.0.0" +docx2txt = ">=0.8,<0.9" +embedchain = ">=0.1.113,<0.2.0" +lancedb = ">=0.5.4,<0.6.0" langchain = ">=0.1.4,<0.2.0" -openai = "^1.12.0" -pydantic = "^2.6.1" -pyright = "^1.1.350" -pytest = "^8.0.0" -pytube = "^15.0.0" -requests = "^2.31.0" -selenium = "^4.18.1" - -[package.source] -type = "directory" -url = "../crewai-tools" +openai = ">=1.12.0,<2.0.0" +pydantic = ">=2.6.1,<3.0.0" +pyright = ">=1.1.350,<2.0.0" +pytest = ">=8.0.0,<9.0.0" +pytube = ">=15.0.0,<16.0.0" +requests = ">=2.31.0,<3.0.0" +selenium = ">=4.18.1,<5.0.0" [[package]] name = "cssselect2" @@ -2506,8 +2505,8 @@ files = [ [package.dependencies] orjson = ">=3.9.14,<4.0.0" pydantic = [ - {version = ">=2.7.4,<3.0.0", markers = "python_full_version >= \"3.12.4\""}, {version = ">=1,<3", markers = "python_full_version < \"3.12.4\""}, + {version = ">=2.7.4,<3.0.0", markers = "python_full_version >= \"3.12.4\""}, ] requests = ">=2,<3" @@ -3935,8 +3934,8 @@ files = [ annotated-types = ">=0.4.0" pydantic-core = "2.20.0" typing-extensions = [ - {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, {version = ">=4.6.1", markers = "python_version < \"3.13\""}, + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, ] [package.extras] @@ -6034,4 +6033,4 @@ tools = ["crewai-tools"] [metadata] lock-version = "2.0" python-versions = ">=3.10,<=3.13" -content-hash = "4fcffef0372bbf95065b56b63db8f1c2fa83999329bf67d370c9b736382f02f4" +content-hash = "d4ea0d71723ecc2bad629c387dd786b6a96c553b1e3e298516fdfcd2059d1019" diff --git a/pyproject.toml b/pyproject.toml index 9e4bd1fc3..9f99bafef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "crewai" -version = "0.35.6" +version = "0.35.7" description = "Cutting-edge framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks." authors = ["Joao Moura "] readme = "README.md" @@ -21,7 +21,7 @@ opentelemetry-sdk = "^1.22.0" opentelemetry-exporter-otlp-proto-http = "^1.22.0" instructor = "1.3.3" regex = "^2023.12.25" -crewai-tools = { version = "^0.4.4", optional = true } +crewai-tools = { version = "^0.4.5", optional = true } click = "^8.1.7" python-dotenv = "^1.0.0" appdirs = "^1.4.4" @@ -43,7 +43,7 @@ mkdocs-material = { extras = ["imaging"], version = "^9.5.7" } mkdocs-material-extensions = "^1.3.1" pillow = "^10.2.0" cairosvg = "^2.7.1" -crewai-tools = "^0.4.4" +crewai-tools = "^0.4.5" [tool.poetry.group.test.dependencies] pytest = "^8.0.0" diff --git a/src/crewai/cli/templates/pyproject.toml b/src/crewai/cli/templates/pyproject.toml index e9fc7454b..5d70ae362 100644 --- a/src/crewai/cli/templates/pyproject.toml +++ b/src/crewai/cli/templates/pyproject.toml @@ -6,7 +6,7 @@ authors = ["Your Name "] [tool.poetry.dependencies] python = ">=3.10,<=3.13" -crewai = { extras = ["tools"], version = "^0.35.6" } +crewai = { extras = ["tools"], version = "^0.35.7" } [tool.poetry.scripts] {{folder_name}} = "{{folder_name}}.main:run"