composio-crewai


Namecomposio-crewai JSON
Version 0.2.63 PyPI version JSON
download
home_pagehttps://github.com/SamparkAI/composio_sdk
SummaryUse Composio to get an array of tools with your CrewAI agent.
upload_time2024-05-23 11:23:36
maintainerNone
docs_urlNone
authorHimanshu
requires_python<4,>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Composio <> CrewAI

![CrewAI Logo](https://i.imgur.com/jXeNUda.png)

**Composio** enables **CrewAI agents** to connect with numerous tools, making it easy for these agents to interact with external applications seamlessly.

## Installation and Setup

Start by installing Composio CrewAI and connecting your GitHub account to enable GitHub functionalities for your agents.

```bash
pip install composio_crewai
composio-cli add github  # Connect your GitHub account
composio-cli show-apps   # Check available applications
```

## Goal

Automate GitHub interactions, such as starring a repository, using natural language commands through a CrewAI Agent.

### Step-by-Step Guide

#### 1. Import Base Packages

Prepare your environment by importing the necessary packages for CrewAI and setting up your language model.

```python
from crewai import Agent, Task
from langchain_openai import ChatOpenAI

# Initialize the language model with your OpenAI API key
llm = ChatOpenAI(openai_api_key="sk-<OPENAI KEY>")
```

#### 2. Fetch Tools via Composio

Initialize the Composio toolset for interacting with GitHub.

```python
from composio_crewai import ComposioToolset, Action, App

# Initialize the toolset with GitHub application
tools = ComposioToolset(apps=[App.GITHUB])
```

#### 3. Execute the Agent

Configure and execute the CrewAI agent to perform GitHub actions.

```python
crewai_agent = Agent(
    role='Github Agent',
    goal="You take action on Github using Github APIs",
    backstory="You are an AI agent responsible for taking actions on Github on users' behalf using Github APIs",
    verbose=True,
    tools=tools,
    llm=llm
)

# Define the task
task = Task(
    description="Star a repo SamparkAI/docs on GitHub",
    agent=crewai_agent,
    expected_output="if the star happened"
)

# Execute the task
task.execute()
```

#### 4. Check Response

Verify the agent's actions and responses to ensure the task was completed successfully.

```bash
> Entering new CrewAgentExecutor chain...
> I need to star the repository "SamparkAI/docs" on GitHub.
> {'execution_details': {'executed': True}, 'response_data': ''}
> Finished chain.
```

### Advanced Configuration

- **Filter Specific Actions:** Limit the actions an agent can perform for enhanced security and operational focus.

```python
toolsGithubCreateIssue = ComposioToolset(actions=[Action.GITHUB_CREATE_ISSUE])
```

- **Filter Specific Apps:** Restrict the agent's access to certain applications for streamlined operations.

```python
toolsAsanaGithub = ComposioToolset(apps=[App.ASANA, App.GITHUB])
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/SamparkAI/composio_sdk",
    "name": "composio-crewai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Himanshu",
    "author_email": "himanshu@composio.dev",
    "download_url": "https://files.pythonhosted.org/packages/4f/ea/3af21aff3b5a91c107b9c4f1cafcf4535873768ba4e179842565bfbcdb89/composio_crewai-0.2.63.tar.gz",
    "platform": null,
    "description": "# Composio <> CrewAI\n\n![CrewAI Logo](https://i.imgur.com/jXeNUda.png)\n\n**Composio** enables **CrewAI agents** to connect with numerous tools, making it easy for these agents to interact with external applications seamlessly.\n\n## Installation and Setup\n\nStart by installing Composio CrewAI and connecting your GitHub account to enable GitHub functionalities for your agents.\n\n```bash\npip install composio_crewai\ncomposio-cli add github  # Connect your GitHub account\ncomposio-cli show-apps   # Check available applications\n```\n\n## Goal\n\nAutomate GitHub interactions, such as starring a repository, using natural language commands through a CrewAI Agent.\n\n### Step-by-Step Guide\n\n#### 1. Import Base Packages\n\nPrepare your environment by importing the necessary packages for CrewAI and setting up your language model.\n\n```python\nfrom crewai import Agent, Task\nfrom langchain_openai import ChatOpenAI\n\n# Initialize the language model with your OpenAI API key\nllm = ChatOpenAI(openai_api_key=\"sk-<OPENAI KEY>\")\n```\n\n#### 2. Fetch Tools via Composio\n\nInitialize the Composio toolset for interacting with GitHub.\n\n```python\nfrom composio_crewai import ComposioToolset, Action, App\n\n# Initialize the toolset with GitHub application\ntools = ComposioToolset(apps=[App.GITHUB])\n```\n\n#### 3. Execute the Agent\n\nConfigure and execute the CrewAI agent to perform GitHub actions.\n\n```python\ncrewai_agent = Agent(\n    role='Github Agent',\n    goal=\"You take action on Github using Github APIs\",\n    backstory=\"You are an AI agent responsible for taking actions on Github on users' behalf using Github APIs\",\n    verbose=True,\n    tools=tools,\n    llm=llm\n)\n\n# Define the task\ntask = Task(\n    description=\"Star a repo SamparkAI/docs on GitHub\",\n    agent=crewai_agent,\n    expected_output=\"if the star happened\"\n)\n\n# Execute the task\ntask.execute()\n```\n\n#### 4. Check Response\n\nVerify the agent's actions and responses to ensure the task was completed successfully.\n\n```bash\n> Entering new CrewAgentExecutor chain...\n> I need to star the repository \"SamparkAI/docs\" on GitHub.\n> {'execution_details': {'executed': True}, 'response_data': ''}\n> Finished chain.\n```\n\n### Advanced Configuration\n\n- **Filter Specific Actions:** Limit the actions an agent can perform for enhanced security and operational focus.\n\n```python\ntoolsGithubCreateIssue = ComposioToolset(actions=[Action.GITHUB_CREATE_ISSUE])\n```\n\n- **Filter Specific Apps:** Restrict the agent's access to certain applications for streamlined operations.\n\n```python\ntoolsAsanaGithub = ComposioToolset(apps=[App.ASANA, App.GITHUB])\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Use Composio to get an array of tools with your CrewAI agent.",
    "version": "0.2.63",
    "project_urls": {
        "Homepage": "https://github.com/SamparkAI/composio_sdk"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f430efb08d23c22bd9cd1e71a24fd43f6927431623833d082ce51ac29b9b1fdc",
                "md5": "9a4cb7264c90cb3717a76e7fa408e3be",
                "sha256": "c92854dc69526d840b059711449618bb181908162c3dc52317594963eb22a04b"
            },
            "downloads": -1,
            "filename": "composio_crewai-0.2.63-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9a4cb7264c90cb3717a76e7fa408e3be",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.9",
            "size": 2723,
            "upload_time": "2024-05-23T11:23:34",
            "upload_time_iso_8601": "2024-05-23T11:23:34.486706Z",
            "url": "https://files.pythonhosted.org/packages/f4/30/efb08d23c22bd9cd1e71a24fd43f6927431623833d082ce51ac29b9b1fdc/composio_crewai-0.2.63-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4fea3af21aff3b5a91c107b9c4f1cafcf4535873768ba4e179842565bfbcdb89",
                "md5": "76094eac5036ae7e5bb73e46d65c7a6b",
                "sha256": "d3d0ac581b04d3a33093398e188d88cce30d54488af59888d237cab6c2ee87d8"
            },
            "downloads": -1,
            "filename": "composio_crewai-0.2.63.tar.gz",
            "has_sig": false,
            "md5_digest": "76094eac5036ae7e5bb73e46d65c7a6b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.9",
            "size": 2645,
            "upload_time": "2024-05-23T11:23:36",
            "upload_time_iso_8601": "2024-05-23T11:23:36.094728Z",
            "url": "https://files.pythonhosted.org/packages/4f/ea/3af21aff3b5a91c107b9c4f1cafcf4535873768ba4e179842565bfbcdb89/composio_crewai-0.2.63.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-23 11:23:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SamparkAI",
    "github_project": "composio_sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "composio-crewai"
}
        
Elapsed time: 0.29433s