praisonAI


NamepraisonAI JSON
Version 0.0.21 PyPI version JSON
download
home_pageNone
SummarypraisonAI application combines AutoGen and CrewAI or similar frameworks into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customization, and efficient human-agent collaboration.
upload_time2024-05-14 07:21:10
maintainerNone
docs_urlNone
authorMervin Praison
requires_python<3.13,>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements rich pyautogen crewai gradio crewai_tools duckduckgo_search praisonai_tools
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Praison AI

Praison AI, leveraging both AutoGen and CrewAI or any other agent framework, represents a low-code, centralised framework designed to simplify the creation and orchestration of multi-agent systems for various LLM applications, emphasizing ease of use, customization, and human-agent interaction.

## TL;DR
```bash
pip install praisonai
export OPENAI_API_KEY="Enter your API key"
praisonai --init create a movie script about dog in moon
praisonai
```

## Installation

```bash
pip install praisonai
```

## Initialise

```bash
export OPENAI_API_KEY="Enter your API key"
```

Generate your OPENAI API KEY from here: https://platform.openai.com/api-keys

Note: You can use other providers such as Ollama, Mistral ... etc. Details are provided at the bottom.
    
```bash
praisonai --init create a movie script about dog in moon
```
This will automatically create agents.yaml file in the current directory.

### To initialse with a specific agent framework (Optional):

```bash
praisonai --framework autogen --init create movie script about cat in mars
```

## Run

```bash
praisonai
```

or 
    
```bash
python -m praisonai
```

### Specify the agent framework (Optional):

```bash
praisonai --framework autogen
```

### Full Automatic Mode

```bash
praisonai --auto create a movie script about Dog in Moon
```

## Create Custom Tools

### TL;DR to Create a Custom Tool

```bash
pip install praisonai duckduckgo-search
export OPENAI_API_KEY="Enter your API key"
praisonai --init research about the latest AI News and prepare a detailed report
```

- Add `- InternetSearchTool` in the agents.yaml file in the tools section. 
- Create a file called tools.py and add this code [tools.py](./tools.py)

```bash
praisonai
```

### Pre-requisite to Create a Custom Tool
`agents.yaml` file should be present in the current directory. 

If it doesn't exist, create it by running the command `praisonai --init research about the latest AI News and prepare a detailed report`.

### Step 1 to Create a Custom Tool

Create a file called tools.py in the same directory as the agents.yaml file.

```python
# example tools.py
from duckduckgo_search import DDGS
from praisonai_tools import BaseTool

class InternetSearchTool(BaseTool):
    name: str = "InternetSearchTool"
    description: str = "Search Internet for relevant information based on a query or latest news"

    def _run(self, query: str):
        ddgs = DDGS()
        results = ddgs.text(keywords=query, region='wt-wt', safesearch='moderate', max_results=5)
        return results
```

### Step 2 to Create a Custom Tool

Add the tool to the agents.yaml file as show below under the tools section `- InternetSearchTool`.

```yaml
framework: crewai
topic: research about the latest AI News and prepare a detailed report
roles:
  research_analyst:
    backstory: Experienced in gathering and analyzing data related to AI news trends.
    goal: Analyze AI News trends
    role: Research Analyst
    tasks:
      gather_data:
        description: Conduct in-depth research on the latest AI News trends from reputable
          sources.
        expected_output: Comprehensive report on current AI News trends.
    tools:
    - InternetSearchTool
```

## Test
    
```bash
python -m unittest tests.test 
```

## Agents Playbook 

### Simple Playbook Example

```yaml
framework: crewai
topic: Artificial Intelligence
roles:
  screenwriter:
    backstory: 'Skilled in crafting scripts with engaging dialogue about {topic}.'
    goal: Create scripts from concepts.
    role: Screenwriter
    tasks:
      scriptwriting_task:
        description: 'Develop scripts with compelling characters and dialogue about {topic}.'
        expected_output: 'Complete script ready for production.'
```

### Detailed Playbook Example

```yaml
framework: crewai
topic: Artificial Intelligence
roles:
  movie_concept_creator:
    backstory: 'Creative thinker with a deep understanding of cinematic storytelling,
      capable of using AI-generated storylines to create unique and compelling movie
      ideas.'
    goal: Generate engaging movie concepts using AI storylines
    role: Movie Concept Creator
    tasks:
      movie_concept_development:
        description: 'Develop movie concepts from AI-generated storylines, ensuring
          they are engaging and have strong narrative arcs.'
        expected_output: 'Well-structured movie concept document with character
          bios, settings, and plot outlines.'
  screenwriter:
    backstory: 'Expert in writing engaging dialogue and script structure, able to
      turn movie concepts into production-ready scripts.'
    goal: Write compelling scripts based on movie concepts
    role: Screenwriter
    tasks:
      scriptwriting_task:
        description: 'Turn movie concepts into polished scripts with well-developed
          characters, strong dialogue, and effective scene transitions.'
        expected_output: 'Production-ready script with a beginning, middle, and
          end, along with character development and engaging dialogues.'
  editor:
    backstory: 'Adept at identifying inconsistencies, improving language usage,
      and maintaining the overall flow of the script.'
    goal: Refine the scripts and ensure continuity of the movie storyline
    role: Editor
    tasks:
      editing_task:
        description: 'Review, edit, and refine the scripts to ensure they are cohesive
          and follow a well-structured narrative.'
        expected_output: 'A polished final draft of the script with no inconsistencies,
          strong character development, and effective dialogue.'
dependencies: []
```

## Include praisonai package in your project

```python
from praisonai import PraisonAI

def basic(): # Basic Mode
    praison_ai = PraisonAI(agent_file="agents.yaml")
    praison_ai.main()
    
def advanced(): # Advanced Mode with options
    praison_ai = PraisonAI(
        agent_file="agents.yaml",
        framework="autogen",
    )
    praison_ai.main()
    
def auto(): # Full Automatic Mode
    praison_ai = PraisonAI(
        auto="Create a movie script about car in mars",
        framework="autogen"
    )
    print(praison_ai.framework)
    praison_ai.main()

if __name__ == "__main__":
    basic()
    advanced()
    auto()
```

## Deploy 
    
```bash
gcloud init
gcloud services enable run.googleapis.com
gcloud services enable containerregistry.googleapis.com
gcloud services enable cloudbuild.googleapis.com

export OPENAI_MODEL_NAME="gpt-4-turbo-preview"
export OPENAI_API_KEY="Enter your API key"
export OPENAI_API_BASE="https://api.openai.com/v1"

yes | gcloud auth configure-docker us-central1-docker.pkg.dev 
gcloud artifacts repositories create praisonai-repository --repository-format=docker --location=us-central1

PROJECT_ID=$(gcloud config get-value project)
TAG="latest"
docker build --platform linux/amd64 -t gcr.io/${PROJECT_ID}/praisonai-app:${TAG} .
docker tag gcr.io/${PROJECT_ID}/praisonai-app:${TAG} us-central1-docker.pkg.dev/${PROJECT_ID}/praisonai-repository/praisonai-app:${TAG}
docker push us-central1-docker.pkg.dev/${PROJECT_ID}/praisonai-repository/praisonai-app:${TAG}

gcloud run deploy praisonai-service \
    --image us-central1-docker.pkg.dev/${PROJECT_ID}/praisonai-repository/praisonai-app:${TAG} \
    --platform managed \
    --region us-central1 \
    --allow-unauthenticated \
    --set-env-vars OPENAI_MODEL_NAME=${OPENAI_MODEL_NAME},OPENAI_API_KEY=${OPENAI_API_KEY},OPENAI_API_BASE=${OPENAI_API_BASE}
```

## Other Models

```bash
Ollama
OPENAI_API_BASE='http://localhost:11434/v1'
OPENAI_MODEL_NAME='mistral'
OPENAI_API_KEY='NA'

FastChat¶
OPENAI_API_BASE="http://localhost:8001/v1"
OPENAI_MODEL_NAME='oh-2.5m7b-q51'
OPENAI_API_KEY=NA

LM Studio¶
OPENAI_API_BASE="http://localhost:8000/v1"
OPENAI_MODEL_NAME=NA
OPENAI_API_KEY=NA

Mistral API¶
OPENAI_API_BASE=https://api.mistral.ai/v1
OPENAI_MODEL_NAME="mistral-small"
OPENAI_API_KEY=your-mistral-api-key
```

## Contributing

- Fork on GitHub: Use the "Fork" button on the repository page.
- Clone your fork: `git clone https://github.com/yourusername/praisonAI.git`
- Create a branch: `git checkout -b new-feature`
- Make changes and commit: `git commit -am "Add some feature"`
- Push to your fork: `git push origin new-feature`
- Submit a pull request via GitHub's web interface.
- Await feedback from project maintainers.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "praisonAI",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Mervin Praison",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/fd/82/4c1d8a6984016a9d7678dd575977d3a1b0562319963eab80825dbc82f5d6/praisonai-0.0.21.tar.gz",
    "platform": null,
    "description": "# Praison AI\n\nPraison AI, leveraging both AutoGen and CrewAI or any other agent framework, represents a low-code, centralised framework designed to simplify the creation and orchestration of multi-agent systems for various LLM applications, emphasizing ease of use, customization, and human-agent interaction.\n\n## TL;DR\n```bash\npip install praisonai\nexport OPENAI_API_KEY=\"Enter your API key\"\npraisonai --init create a movie script about dog in moon\npraisonai\n```\n\n## Installation\n\n```bash\npip install praisonai\n```\n\n## Initialise\n\n```bash\nexport OPENAI_API_KEY=\"Enter your API key\"\n```\n\nGenerate your OPENAI API KEY from here: https://platform.openai.com/api-keys\n\nNote: You can use other providers such as Ollama, Mistral ... etc. Details are provided at the bottom.\n    \n```bash\npraisonai --init create a movie script about dog in moon\n```\nThis will automatically create agents.yaml file in the current directory.\n\n### To initialse with a specific agent framework (Optional):\n\n```bash\npraisonai --framework autogen --init create movie script about cat in mars\n```\n\n## Run\n\n```bash\npraisonai\n```\n\nor \n    \n```bash\npython -m praisonai\n```\n\n### Specify the agent framework (Optional):\n\n```bash\npraisonai --framework autogen\n```\n\n### Full Automatic Mode\n\n```bash\npraisonai --auto create a movie script about Dog in Moon\n```\n\n## Create Custom Tools\n\n### TL;DR to Create a Custom Tool\n\n```bash\npip install praisonai duckduckgo-search\nexport OPENAI_API_KEY=\"Enter your API key\"\npraisonai --init research about the latest AI News and prepare a detailed report\n```\n\n- Add `- InternetSearchTool` in the agents.yaml file in the tools section. \n- Create a file called tools.py and add this code [tools.py](./tools.py)\n\n```bash\npraisonai\n```\n\n### Pre-requisite to Create a Custom Tool\n`agents.yaml` file should be present in the current directory. \n\nIf it doesn't exist, create it by running the command `praisonai --init research about the latest AI News and prepare a detailed report`.\n\n### Step 1 to Create a Custom Tool\n\nCreate a file called tools.py in the same directory as the agents.yaml file.\n\n```python\n# example tools.py\nfrom duckduckgo_search import DDGS\nfrom praisonai_tools import BaseTool\n\nclass InternetSearchTool(BaseTool):\n    name: str = \"InternetSearchTool\"\n    description: str = \"Search Internet for relevant information based on a query or latest news\"\n\n    def _run(self, query: str):\n        ddgs = DDGS()\n        results = ddgs.text(keywords=query, region='wt-wt', safesearch='moderate', max_results=5)\n        return results\n```\n\n### Step 2 to Create a Custom Tool\n\nAdd the tool to the agents.yaml file as show below under the tools section `- InternetSearchTool`.\n\n```yaml\nframework: crewai\ntopic: research about the latest AI News and prepare a detailed report\nroles:\n  research_analyst:\n    backstory: Experienced in gathering and analyzing data related to AI news trends.\n    goal: Analyze AI News trends\n    role: Research Analyst\n    tasks:\n      gather_data:\n        description: Conduct in-depth research on the latest AI News trends from reputable\n          sources.\n        expected_output: Comprehensive report on current AI News trends.\n    tools:\n    - InternetSearchTool\n```\n\n## Test\n    \n```bash\npython -m unittest tests.test \n```\n\n## Agents Playbook \n\n### Simple Playbook Example\n\n```yaml\nframework: crewai\ntopic: Artificial Intelligence\nroles:\n  screenwriter:\n    backstory: 'Skilled in crafting scripts with engaging dialogue about {topic}.'\n    goal: Create scripts from concepts.\n    role: Screenwriter\n    tasks:\n      scriptwriting_task:\n        description: 'Develop scripts with compelling characters and dialogue about {topic}.'\n        expected_output: 'Complete script ready for production.'\n```\n\n### Detailed Playbook Example\n\n```yaml\nframework: crewai\ntopic: Artificial Intelligence\nroles:\n  movie_concept_creator:\n    backstory: 'Creative thinker with a deep understanding of cinematic storytelling,\n      capable of using AI-generated storylines to create unique and compelling movie\n      ideas.'\n    goal: Generate engaging movie concepts using AI storylines\n    role: Movie Concept Creator\n    tasks:\n      movie_concept_development:\n        description: 'Develop movie concepts from AI-generated storylines, ensuring\n          they are engaging and have strong narrative arcs.'\n        expected_output: 'Well-structured movie concept document with character\n          bios, settings, and plot outlines.'\n  screenwriter:\n    backstory: 'Expert in writing engaging dialogue and script structure, able to\n      turn movie concepts into production-ready scripts.'\n    goal: Write compelling scripts based on movie concepts\n    role: Screenwriter\n    tasks:\n      scriptwriting_task:\n        description: 'Turn movie concepts into polished scripts with well-developed\n          characters, strong dialogue, and effective scene transitions.'\n        expected_output: 'Production-ready script with a beginning, middle, and\n          end, along with character development and engaging dialogues.'\n  editor:\n    backstory: 'Adept at identifying inconsistencies, improving language usage,\n      and maintaining the overall flow of the script.'\n    goal: Refine the scripts and ensure continuity of the movie storyline\n    role: Editor\n    tasks:\n      editing_task:\n        description: 'Review, edit, and refine the scripts to ensure they are cohesive\n          and follow a well-structured narrative.'\n        expected_output: 'A polished final draft of the script with no inconsistencies,\n          strong character development, and effective dialogue.'\ndependencies: []\n```\n\n## Include praisonai package in your project\n\n```python\nfrom praisonai import PraisonAI\n\ndef basic(): # Basic Mode\n    praison_ai = PraisonAI(agent_file=\"agents.yaml\")\n    praison_ai.main()\n    \ndef advanced(): # Advanced Mode with options\n    praison_ai = PraisonAI(\n        agent_file=\"agents.yaml\",\n        framework=\"autogen\",\n    )\n    praison_ai.main()\n    \ndef auto(): # Full Automatic Mode\n    praison_ai = PraisonAI(\n        auto=\"Create a movie script about car in mars\",\n        framework=\"autogen\"\n    )\n    print(praison_ai.framework)\n    praison_ai.main()\n\nif __name__ == \"__main__\":\n    basic()\n    advanced()\n    auto()\n```\n\n## Deploy \n    \n```bash\ngcloud init\ngcloud services enable run.googleapis.com\ngcloud services enable containerregistry.googleapis.com\ngcloud services enable cloudbuild.googleapis.com\n\nexport OPENAI_MODEL_NAME=\"gpt-4-turbo-preview\"\nexport OPENAI_API_KEY=\"Enter your API key\"\nexport OPENAI_API_BASE=\"https://api.openai.com/v1\"\n\nyes | gcloud auth configure-docker us-central1-docker.pkg.dev \ngcloud artifacts repositories create praisonai-repository --repository-format=docker --location=us-central1\n\nPROJECT_ID=$(gcloud config get-value project)\nTAG=\"latest\"\ndocker build --platform linux/amd64 -t gcr.io/${PROJECT_ID}/praisonai-app:${TAG} .\ndocker tag gcr.io/${PROJECT_ID}/praisonai-app:${TAG} us-central1-docker.pkg.dev/${PROJECT_ID}/praisonai-repository/praisonai-app:${TAG}\ndocker push us-central1-docker.pkg.dev/${PROJECT_ID}/praisonai-repository/praisonai-app:${TAG}\n\ngcloud run deploy praisonai-service \\\n    --image us-central1-docker.pkg.dev/${PROJECT_ID}/praisonai-repository/praisonai-app:${TAG} \\\n    --platform managed \\\n    --region us-central1 \\\n    --allow-unauthenticated \\\n    --set-env-vars OPENAI_MODEL_NAME=${OPENAI_MODEL_NAME},OPENAI_API_KEY=${OPENAI_API_KEY},OPENAI_API_BASE=${OPENAI_API_BASE}\n```\n\n## Other Models\n\n```bash\nOllama\nOPENAI_API_BASE='http://localhost:11434/v1'\nOPENAI_MODEL_NAME='mistral'\nOPENAI_API_KEY='NA'\n\nFastChat\u00b6\nOPENAI_API_BASE=\"http://localhost:8001/v1\"\nOPENAI_MODEL_NAME='oh-2.5m7b-q51'\nOPENAI_API_KEY=NA\n\nLM Studio\u00b6\nOPENAI_API_BASE=\"http://localhost:8000/v1\"\nOPENAI_MODEL_NAME=NA\nOPENAI_API_KEY=NA\n\nMistral API\u00b6\nOPENAI_API_BASE=https://api.mistral.ai/v1\nOPENAI_MODEL_NAME=\"mistral-small\"\nOPENAI_API_KEY=your-mistral-api-key\n```\n\n## Contributing\n\n- Fork on GitHub: Use the \"Fork\" button on the repository page.\n- Clone your fork: `git clone https://github.com/yourusername/praisonAI.git`\n- Create a branch: `git checkout -b new-feature`\n- Make changes and commit: `git commit -am \"Add some feature\"`\n- Push to your fork: `git push origin new-feature`\n- Submit a pull request via GitHub's web interface.\n- Await feedback from project maintainers.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "praisonAI application combines AutoGen and CrewAI or similar frameworks into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customization, and efficient human-agent collaboration.",
    "version": "0.0.21",
    "project_urls": {
        "Homepage": "https://github.com/mervinpraison/praisonAI",
        "Repository": "https://github.com/mervinpraison/praisonAI"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21f0da6ea420cc3fea0344e4e1e1af7cba833b1737f7f3119fe18998089b0bdd",
                "md5": "57f426e119cffc9906f00bceb5bfa915",
                "sha256": "6af82b9469ebfe0bfd153329fc57400d0aea331cb6c8106508c344306a5c6a63"
            },
            "downloads": -1,
            "filename": "praisonai-0.0.21-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "57f426e119cffc9906f00bceb5bfa915",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.10",
            "size": 16453,
            "upload_time": "2024-05-14T07:21:07",
            "upload_time_iso_8601": "2024-05-14T07:21:07.646121Z",
            "url": "https://files.pythonhosted.org/packages/21/f0/da6ea420cc3fea0344e4e1e1af7cba833b1737f7f3119fe18998089b0bdd/praisonai-0.0.21-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fd824c1d8a6984016a9d7678dd575977d3a1b0562319963eab80825dbc82f5d6",
                "md5": "f566163edffb24d5ee63e7001a2c5492",
                "sha256": "bb87650a3459134bcc7d8877e67c8bf2fb3a7f0d3e1137ee634e15c6ef499df5"
            },
            "downloads": -1,
            "filename": "praisonai-0.0.21.tar.gz",
            "has_sig": false,
            "md5_digest": "f566163edffb24d5ee63e7001a2c5492",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.10",
            "size": 15584,
            "upload_time": "2024-05-14T07:21:10",
            "upload_time_iso_8601": "2024-05-14T07:21:10.275242Z",
            "url": "https://files.pythonhosted.org/packages/fd/82/4c1d8a6984016a9d7678dd575977d3a1b0562319963eab80825dbc82f5d6/praisonai-0.0.21.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-14 07:21:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mervinpraison",
    "github_project": "praisonAI",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "rich",
            "specs": [
                [
                    ">=",
                    "13.7"
                ]
            ]
        },
        {
            "name": "pyautogen",
            "specs": [
                [
                    ">=",
                    "0.2.19"
                ]
            ]
        },
        {
            "name": "crewai",
            "specs": [
                [
                    ">=",
                    "0.22.5"
                ]
            ]
        },
        {
            "name": "gradio",
            "specs": [
                [
                    ">=",
                    "4.20.0"
                ]
            ]
        },
        {
            "name": "crewai_tools",
            "specs": []
        },
        {
            "name": "duckduckgo_search",
            "specs": []
        },
        {
            "name": "praisonai_tools",
            "specs": []
        }
    ],
    "lcname": "praisonai"
}
        
Elapsed time: 0.61029s