## 🚀🔗 Leveraging Claude with Composio
Facilitate the integration of Claude with Composio to empower Claude models to directly interact with external applications, broadening their capabilities and application scope.
### Objective
- **Automate starring a GitHub repository** using conversational instructions via Claude Function Calls.
### 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-claude
# 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 Claude and setting up your client.
```python
import anthropic
# Initialize Claude client
client = anthropic.Anthropic()
```
### Step 2: Integrating GitHub Tools with Composio
This step involves fetching and integrating GitHub tools provided by Composio, enabling enhanced functionality for LangChain operations.
```python
from composio_claude import App, ComposioToolSet
toolset = ComposioToolSet()
actions = toolset.get_tools(tools=App.GITHUB)
```
### Step 3: Agent Execution
This step involves configuring and executing the agent to carry out actions, such as starring a GitHub repository.
```python
my_task = "Star a repo composiohq/composio on GitHub"
# Create a chat completion request to decide on the action
response = client.beta.tools.messages.create(
model="claude-3-opus-20240229",
max_tokens=1024,
tools= actions,
messages=[{"role": "user", "content": "Star me composiohq/composio repo in github."}],
)
pprint(response)
```
### Step 4: Validate Execution Response
Execute the following code to validate the response, ensuring that the intended task has been successfully completed.
```python
result = toolset.handle_tool_calls(response)
pprint(result)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/ComposioHQ/composio",
"name": "composio-claude",
"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/73/bd/5ca60a8957d647f39a0c240e03ba9586e554b031bc02cb1155e80ee4ca49/composio_claude-0.6.19.tar.gz",
"platform": null,
"description": "## \ud83d\ude80\ud83d\udd17 Leveraging Claude with Composio\n\nFacilitate the integration of Claude with Composio to empower Claude models 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 Claude Function Calls.\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-claude\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 Claude and setting up your client.\n\n```python\nimport anthropic\n\n# Initialize Claude client\nclient = anthropic.Anthropic()\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 LangChain operations.\n```python\nfrom composio_claude import App, ComposioToolSet\n\ntoolset = ComposioToolSet()\nactions = toolset.get_tools(tools=App.GITHUB)\n```\n\n### Step 3: Agent Execution\n\nThis step involves configuring and executing the agent to carry out actions, such as starring a GitHub repository.\n\n```python\nmy_task = \"Star a repo composiohq/composio on GitHub\"\n\n# Create a chat completion request to decide on the action\nresponse = client.beta.tools.messages.create(\n model=\"claude-3-opus-20240229\",\n max_tokens=1024,\n tools= actions,\n messages=[{\"role\": \"user\", \"content\": \"Star me composiohq/composio repo in github.\"}],\n)\npprint(response)\n```\n\n### Step 4: Validate Execution Response\n\nExecute the following code to validate the response, ensuring that the intended task has been successfully completed.\n\n```python\nresult = toolset.handle_tool_calls(response)\npprint(result)\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Use Composio to get an array of tools with your Claude LLMs.",
"version": "0.6.19",
"project_urls": {
"Homepage": "https://github.com/ComposioHQ/composio"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2ce262f4ef49bd5d36c4e2cb1e173f06468118044249bfd87f80ad8bde756bbe",
"md5": "031c2defc290610dce118aa7d384fef2",
"sha256": "1b12e45245306cf176e348ab2a679357b328c518af9658fa2960283af36cd6da"
},
"downloads": -1,
"filename": "composio_claude-0.6.19-py3-none-any.whl",
"has_sig": false,
"md5_digest": "031c2defc290610dce118aa7d384fef2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.9",
"size": 4843,
"upload_time": "2025-01-28T19:25:23",
"upload_time_iso_8601": "2025-01-28T19:25:23.751698Z",
"url": "https://files.pythonhosted.org/packages/2c/e2/62f4ef49bd5d36c4e2cb1e173f06468118044249bfd87f80ad8bde756bbe/composio_claude-0.6.19-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "73bd5ca60a8957d647f39a0c240e03ba9586e554b031bc02cb1155e80ee4ca49",
"md5": "bb83821602456d31ecea1f93b790bae5",
"sha256": "a39e87f615e7c7c2eb7a68095a79d67681a31a112353d7efcf72f06a69b03c27"
},
"downloads": -1,
"filename": "composio_claude-0.6.19.tar.gz",
"has_sig": false,
"md5_digest": "bb83821602456d31ecea1f93b790bae5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.9",
"size": 4423,
"upload_time": "2025-01-28T19:25:42",
"upload_time_iso_8601": "2025-01-28T19:25:42.756815Z",
"url": "https://files.pythonhosted.org/packages/73/bd/5ca60a8957d647f39a0c240e03ba9586e554b031bc02cb1155e80ee4ca49/composio_claude-0.6.19.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-28 19:25:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ComposioHQ",
"github_project": "composio",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "composio-claude"
}