## 🚀🔗 Leveraging PraisonAI with Composio
Facilitate the integration of PraisonAI with Composio to empower Praison Agents to directly interact with external applications, broadening their capabilities and application scope.
### Objective
- **Automate starring a GitHub repository** using conversational instructions via PraisonAI Agents.
### 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-praisonai
# 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 Praison and setting up your client.
```python
import os
import yaml
from praisonai import PraisonAI
```
### Step 2: Write the Praison-supported Composio Tools ins `tools.py` file.
This step involves fetching and integrating GitHub tools provided by Composio, and writing them in Praison supported Format, returning the name of tools in a format, that should be added to `agents.yml` file.
```python
from composio_praisonai import Action, ComposioToolSet
composio_toolset = ComposioToolSet()
tools = composio_toolset.get_actions(
actions=[Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER]
)
tool_section_str = composio_toolset.get_tools_section(tools)
print(tool_section_str)
```
### Step 3: Define the 'agents_yml` either in a separate file, or in your script.
This step involves configuring and executing the agent to carry out actions, such as starring a GitHub repository.
```python
agent_yaml = """
framework: "crewai"
topic: "Github Management"
roles:
developer:
role: "Developer"
goal: "An expert programmer"
backstory: "A developer exploring new codebases and have certain tools available to execute different tasks."
tasks:
star_github:
description: "Star a repo composiohq/composio on GitHub"
expected_output: "Response whether the task was executed."
""" + tool_section_str
print(agent_yaml)
```
### Step 4: Run the Praison Agents to execute the goal/task.
Here you initialize PraisonAI class, and execute.
```python
# Create a PraisonAI instance with the agent_yaml content
praison_ai = PraisonAI(agent_yaml=agent_yaml)
# Run PraisonAI
result = praison_ai.main()
# Print the result
print(result)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/ComposioHQ/composio",
"name": "composio-praisonai",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Sawradip",
"author_email": "sawradip@composio.dev",
"download_url": "https://files.pythonhosted.org/packages/a4/00/072a5e636ff37868b37c05e3df385e985a54be912b411d3c0b50c3c48a94/composio_praisonai-0.6.5.tar.gz",
"platform": null,
"description": "## \ud83d\ude80\ud83d\udd17 Leveraging PraisonAI with Composio\n\nFacilitate the integration of PraisonAI with Composio to empower Praison 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 PraisonAI Agents.\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-praisonai\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 Praison and setting up your client.\n\n```python\nimport os\nimport yaml\nfrom praisonai import PraisonAI\n```\n\n### Step 2: Write the Praison-supported Composio Tools ins `tools.py` file.\n\nThis step involves fetching and integrating GitHub tools provided by Composio, and writing them in Praison supported Format, returning the name of tools in a format, that should be added to `agents.yml` file.\n```python\nfrom composio_praisonai import Action, ComposioToolSet\n\ncomposio_toolset = ComposioToolSet()\ntools = composio_toolset.get_actions(\n actions=[Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER]\n)\n\ntool_section_str = composio_toolset.get_tools_section(tools)\nprint(tool_section_str)\n```\n\n### Step 3: Define the 'agents_yml` either in a separate file, or in your script.\n\nThis step involves configuring and executing the agent to carry out actions, such as starring a GitHub repository.\n\n```python\nagent_yaml = \"\"\"\nframework: \"crewai\"\ntopic: \"Github Management\"\n\nroles:\n developer:\n role: \"Developer\"\n goal: \"An expert programmer\"\n backstory: \"A developer exploring new codebases and have certain tools available to execute different tasks.\"\n tasks:\n star_github:\n description: \"Star a repo composiohq/composio on GitHub\"\n expected_output: \"Response whether the task was executed.\"\n\"\"\" + tool_section_str\n\nprint(agent_yaml)\n```\n\n### Step 4: Run the Praison Agents to execute the goal/task.\n\nHere you initialize PraisonAI class, and execute.\n```python\n# Create a PraisonAI instance with the agent_yaml content\npraison_ai = PraisonAI(agent_yaml=agent_yaml)\n\n# Run PraisonAI\nresult = praison_ai.main()\n\n# Print the result\nprint(result)\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Use Composio Tools to enhance your PraisonAI agents capabilities.",
"version": "0.6.5",
"project_urls": {
"Homepage": "https://github.com/ComposioHQ/composio"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9331871eeac0e29fbe45552b90ff92829b2a9b784926a2a755f4ec2dbd88832e",
"md5": "881f4232b7981923bd54a08a37312ce3",
"sha256": "74916008ac615a27ee31780902b9a9541fd3f5529f26ec7d46f9be9e8a3e93e3"
},
"downloads": -1,
"filename": "composio_praisonai-0.6.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "881f4232b7981923bd54a08a37312ce3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 4917,
"upload_time": "2024-12-20T10:48:49",
"upload_time_iso_8601": "2024-12-20T10:48:49.500683Z",
"url": "https://files.pythonhosted.org/packages/93/31/871eeac0e29fbe45552b90ff92829b2a9b784926a2a755f4ec2dbd88832e/composio_praisonai-0.6.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a400072a5e636ff37868b37c05e3df385e985a54be912b411d3c0b50c3c48a94",
"md5": "22fc604d93ea52966a14eee8dffb2410",
"sha256": "60c1b8f7d35d053f7641bee090f3abbe576d6410743628f522aefa3b42ad0be1"
},
"downloads": -1,
"filename": "composio_praisonai-0.6.5.tar.gz",
"has_sig": false,
"md5_digest": "22fc604d93ea52966a14eee8dffb2410",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 4589,
"upload_time": "2024-12-20T10:48:51",
"upload_time_iso_8601": "2024-12-20T10:48:51.612489Z",
"url": "https://files.pythonhosted.org/packages/a4/00/072a5e636ff37868b37c05e3df385e985a54be912b411d3c0b50c3c48a94/composio_praisonai-0.6.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-20 10:48:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ComposioHQ",
"github_project": "composio",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "composio-praisonai"
}