composio-camel


Namecomposio-camel JSON
Version 0.5.32 PyPI version JSON
download
home_pagehttps://github.com/ComposioHQ/composio
SummaryUse Composio to get an array of tools with your Claude LLMs.
upload_time2024-10-17 10:40:52
maintainerNone
docs_urlNone
authorSawradip
requires_python<4,>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## 🚀🔗 Leveraging CamelAI with Composio

Facilitate the integration of Camel Agents with Composio to empower the agents to directly interact with external applications, broadening their capabilities and application scope.

### Objective

- **Automate starring a GitHub repository** using conversational instructions via Camel's Tool Usage ability.

### Installation and Setup

Ensure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities.

```bash
# Install Composio LangChain package
pip install composio-camel

# Connect your GitHub account
composio-cli add github

# View available applications you can connect with
composio-cli show-apps
```

### Usage Steps

#### 1. Import Base Packages

Prepare your environment by initializing necessary imports from Composio & Camel.

```python
from colorama import Fore

from camel.agents import ChatAgent
from camel.configs import ChatGPTConfig
from camel.messages import BaseMessage
from camel.models import ModelFactory
from camel.types import ModelPlatformType, ModelType
from camel.utils import print_text_animated
from composio_camel import ComposioToolSet, Action
```

### Step 2: Integrating GitHub Tools with Composio

This step involves fetching and integrating GitHub tools provided by Composio, enabling enhanced functionality for Camel operations.
```python
composio_toolset = ComposioToolSet()
tools = composio_toolset.get_actions(
    actions=[Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER]
)
```

### Step 3: Camel Agent Setup

This step involves configuring and executing the agent to carry out actions, such as starring a GitHub repository.

```python
# set up LLM model
assistant_model_config = ChatGPTConfig(
    temperature=0.0,
    tools=tools,
)

model = ModelFactory.create(
    model_platform=ModelPlatformType.OPENAI,
    model_type=ModelType.GPT_3_5_TURBO,
    model_config_dict=assistant_model_config.__dict__,
)


# set up agent
assistant_sys_msg = BaseMessage.make_assistant_message(
    role_name="Developer",
    content=(
        "You are a programmer as well an experienced github user. "
        "When asked given a instruction, "
        "you try to use available tools, and execute it"
    ),
)

agent = ChatAgent(
    assistant_sys_msg,
    model,
    tools=tools,
)
agent.reset()
```

### Step 4: Execute with your prompt/task.

Execute the following code to execute the agent, ensuring that the intended task has been successfully completed.

```python
prompt = (
    "I have created a new Github Repo,"
    "Please star my github repository: camel-ai/camel"
)
user_msg = BaseMessage.make_user_message(role_name="User", content=prompt)
print(Fore.YELLOW + f"user prompt:\n{prompt}\n")

response = agent.step(user_msg)
for msg in response.msgs:
    print_text_animated(Fore.GREEN + f"Agent response:\n{msg.content}\n")

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ComposioHQ/composio",
    "name": "composio-camel",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Sawradip",
    "author_email": "sawradip@composio.dev",
    "download_url": "https://files.pythonhosted.org/packages/b3/fa/34a6a9da2e66f2fc24b6145c98b18b667b40a10425575dd7e8ca8d9581be/composio_camel-0.5.32.tar.gz",
    "platform": null,
    "description": "## \ud83d\ude80\ud83d\udd17 Leveraging CamelAI with Composio\n\nFacilitate the integration of Camel Agents with Composio to empower the agents to directly interact with external applications, broadening their capabilities and application scope.\n\n### Objective\n\n- **Automate starring a GitHub repository** using conversational instructions via Camel's Tool Usage ability.\n\n### Installation and Setup\n\nEnsure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities.\n\n```bash\n# Install Composio LangChain package\npip install composio-camel\n\n# Connect your GitHub account\ncomposio-cli add github\n\n# View available applications you can connect with\ncomposio-cli show-apps\n```\n\n### Usage Steps\n\n#### 1. Import Base Packages\n\nPrepare your environment by initializing necessary imports from Composio & Camel.\n\n```python\nfrom colorama import Fore\n\nfrom camel.agents import ChatAgent\nfrom camel.configs import ChatGPTConfig\nfrom camel.messages import BaseMessage\nfrom camel.models import ModelFactory\nfrom camel.types import ModelPlatformType, ModelType\nfrom camel.utils import print_text_animated\nfrom composio_camel import ComposioToolSet, Action\n```\n\n### Step 2: Integrating GitHub Tools with Composio\n\nThis step involves fetching and integrating GitHub tools provided by Composio, enabling enhanced functionality for Camel operations.\n```python\ncomposio_toolset = ComposioToolSet()\ntools = composio_toolset.get_actions(\n    actions=[Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER]\n)\n```\n\n### Step 3: Camel Agent Setup\n\nThis step involves configuring and executing the agent to carry out actions, such as starring a GitHub repository.\n\n```python\n# set up LLM model\nassistant_model_config = ChatGPTConfig(\n    temperature=0.0,\n    tools=tools,\n)\n\nmodel = ModelFactory.create(\n    model_platform=ModelPlatformType.OPENAI,\n    model_type=ModelType.GPT_3_5_TURBO,\n    model_config_dict=assistant_model_config.__dict__,\n)\n\n\n# set up agent\nassistant_sys_msg = BaseMessage.make_assistant_message(\n    role_name=\"Developer\",\n    content=(\n        \"You are a programmer as well an experienced github user. \"\n        \"When asked given a instruction, \"\n        \"you try to use available tools, and execute it\"\n    ),\n)\n\nagent = ChatAgent(\n    assistant_sys_msg,\n    model,\n    tools=tools,\n)\nagent.reset()\n```\n\n### Step 4: Execute with your prompt/task.\n\nExecute the following code to execute the agent, ensuring that the intended task has been successfully completed.\n\n```python\nprompt = (\n    \"I have created a new Github Repo,\"\n    \"Please star my github repository: camel-ai/camel\"\n)\nuser_msg = BaseMessage.make_user_message(role_name=\"User\", content=prompt)\nprint(Fore.YELLOW + f\"user prompt:\\n{prompt}\\n\")\n\nresponse = agent.step(user_msg)\nfor msg in response.msgs:\n    print_text_animated(Fore.GREEN + f\"Agent response:\\n{msg.content}\\n\")\n\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Use Composio to get an array of tools with your Claude LLMs.",
    "version": "0.5.32",
    "project_urls": {
        "Homepage": "https://github.com/ComposioHQ/composio"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7be29f67897cbb85b880fab9ee1501aaa9c1dbf4a5c7975399d92c584ae4aa7a",
                "md5": "5d905932612e3b18bf312ae558b20311",
                "sha256": "6f04f813d517845668b6f31cfc06e61eb1720a0ba4fc3b68cb1e804219bfd869"
            },
            "downloads": -1,
            "filename": "composio_camel-0.5.32-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5d905932612e3b18bf312ae558b20311",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.9",
            "size": 4754,
            "upload_time": "2024-10-17T10:40:50",
            "upload_time_iso_8601": "2024-10-17T10:40:50.976399Z",
            "url": "https://files.pythonhosted.org/packages/7b/e2/9f67897cbb85b880fab9ee1501aaa9c1dbf4a5c7975399d92c584ae4aa7a/composio_camel-0.5.32-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b3fa34a6a9da2e66f2fc24b6145c98b18b667b40a10425575dd7e8ca8d9581be",
                "md5": "d27bca47a7251fca5fa8549484385398",
                "sha256": "3e59da1212d653464026ad37560eb3b85d328e6275368bcdea64cd16d7938a97"
            },
            "downloads": -1,
            "filename": "composio_camel-0.5.32.tar.gz",
            "has_sig": false,
            "md5_digest": "d27bca47a7251fca5fa8549484385398",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.9",
            "size": 4060,
            "upload_time": "2024-10-17T10:40:52",
            "upload_time_iso_8601": "2024-10-17T10:40:52.572902Z",
            "url": "https://files.pythonhosted.org/packages/b3/fa/34a6a9da2e66f2fc24b6145c98b18b667b40a10425575dd7e8ca8d9581be/composio_camel-0.5.32.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-17 10:40:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ComposioHQ",
    "github_project": "composio",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "composio-camel"
}
        
Elapsed time: 0.64601s