cogsgpt


Namecogsgpt JSON
Version 1.0.1 PyPI version JSON
download
home_page
SummaryA multi-modal LLM integrated ChatGPT with Azure Cognitive Service
upload_time2023-05-05 05:10:59
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT License Copyright (c) 2023 Tian Wei Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords chatgpt cognitive service llm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CogsGPT
A conversational system which integrates ChatGPT with Azure Cognitive Services to achieve multimodal capabilities.

<a src="https://img.shields.io/badge/%F0%9F%A4%97-Open%20in%20Spaces-blue" href="https://huggingface.co/spaces/whiskyboy/CogsGPT">
    <img src="https://img.shields.io/badge/%F0%9F%A4%97-Open%20in%20Spaces-blue" alt="Open in Spaces">
</a>

![cogsgpt-demo](./docs/imgs/cogsgpt-demo.png)

*If you find this repo useful, please consider giving it a star! :)*

## Updates
- [2023.04.28] **Now you can go to [CogsGPT on Hugging Face Space](https://huggingface.co/spaces/whiskyboy/CogsGPT) to experience the full capabilities of CogsGPT!!!** We are offering an Azure Cognitive Service resource for FREE to use in the demo. All you need is an OpenAI API key to get started chatting with CogsGPT!
- [2023.04.25] CogsGPT now supports **image** type output! You can ask CogsGPT to crop a thumbnail of an image, or remove its background.
- [2023.04.18] Release the first version of CogsGPT!

## Overview

### What is Azure Cognitive Service
*(Answered by ChatGPT)*

> Azure Cognitive Services is a collection of pre-built machine learning models that developers can use to add intelligent features to their applications without requiring extensive knowledge of data science or machine learning. These services include vision, speech, language, and decision-making capabilities, such as text translation, speech recognition, image recognition, and sentiment analysis. Azure Cognitive Services allows developers to quickly and easily incorporate advanced AI features into their applications, reducing the time and cost of building such features from scratch. It also provides enterprise-level security, scalability, and availability for applications that require high levels of reliability and performance.

### What is CogsGPT
CogsGPT is a conversational system which utilizes the ChatGPT model as the controller and integrates with Azure Cognitive Services as collaborative executors to achieve multimodal capabilities to some extent. Using CogsGPT, you can simply access Azure Cognitive Services via natural language to process image or audio inputs, without any knowledge of the underlying APIs. You can even ask CogsGPT to perform some complex tasks such as summarizing a long speech into a short audio clip while retaining the main information. CogsGPT will automatically decide which services to use and how to use them to achieve the goal.

You can find the list of pre-built services supported by CogsGPT [here](./cogsgpt/metas/task_metas.yaml).

### How does CogsGPT work

The workflow of CogsGPT consists of three stages:
1. Task Planing Stage: In this stage, CogsGPT will leverage ChatGPT to parse user's input into a sequence of Azure Cognitive Service tasks which have the most potentials to solve user's request. Each task may depend on the execution result of previous tasks.
2. Task Execution Stage: In this stage, CogsGPT will execute the tasks sequentially. The execution results will be stored for future reference.
3. Response Generation Stage: In this stage, CogsGPT will leverage ChatGPT again to generate a final response to user's request based on the execution results of the second stage. The response may be a text, an image, an audio, or a combination of them.

## Getting Started

### Prerequisites

- Python 3.8+
- OpenAI API key
- Azure Cognitive Multi-Services resource ([How to deploy](https://learn.microsoft.com/en-us/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Canomaly-detector%2Clanguage-service%2Ccomputer-vision%2Clinux#create-a-new-azure-cognitive-services-resource))
- Set the following environment variables:
    ```bash
    # OpenAI
    export OPENAI_API_TYPE="openai"
    export OPENAI_API_KEY="<OpenAI API Key>"

    # Azure Cognitive Service
    export COGS_ENDPOINT="<Azure Cognitive Service Endpoint>"
    export COGS_KEY="<Azure Cognitive Service Key>"
    export COGS_REGION="<Azure Cognitive Service Region>"
    ```

### Quick Install

```bash
pip install cogsgpt
```

### Usage

You can use CogsGPT in your own application to process image or audio inputs within three lines of codes:
```python
from cogsgpt import CogsGPT

agent = CogsGPT(model_name="gpt-3.5-turbo")
agent.chat("What's the content in a.jpg?")
```

For more details of the usage, please refer to the [API Reference](https://whiskyboy.github.io/cogsgpt/awesome_chat.html)

### Gradio Demo

The CogsGPT Gradio demo is now available on [Hugging Face Space](https://huggingface.co/spaces/whiskyboy/CogsGPT)! To make it easier and more affordable to try out the capabilities of CogsGPT, we are offering an Azure Cognitive Service resource for FREE to use in the demo! All you need is an OpenAI API key to get started chatting with CogsGPT!

You can also use the following commands to run the demo locally with your own Azure Cognitive Service resources (Don't forget to set the environment variables first!):
```bash
pip install gradio
python app.py
```

Now open your favorite browser and ENJOY YOUR CHAT!

## Acknowledgment

This project is inspired by [HuggingGPT](https://github.com/microsoft/JARVIS), and is built on top of [LangChain](https://github.com/hwchase17/langchain).

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

## Contributing

As an open source project, we welcome contributions and suggestions. Please follow the [fork and pull request](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) workflow to contribute to this project. Please do not try to push directly to this repo unless you are maintainer.

## Contact

If you have any questions, please feel free to contact us via <weitian.bnu@gmail.com>

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "cogsgpt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "chatgpt,cognitive service,llm",
    "author": "",
    "author_email": "weitian <weitian.bnu@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0d/68/c15378f85e9d5433141fb28129371a6b3b40d84052b40b8325032e866f6c/cogsgpt-1.0.1.tar.gz",
    "platform": null,
    "description": "# CogsGPT\nA conversational system which integrates ChatGPT with Azure Cognitive Services to achieve multimodal capabilities.\n\n<a src=\"https://img.shields.io/badge/%F0%9F%A4%97-Open%20in%20Spaces-blue\" href=\"https://huggingface.co/spaces/whiskyboy/CogsGPT\">\n    <img src=\"https://img.shields.io/badge/%F0%9F%A4%97-Open%20in%20Spaces-blue\" alt=\"Open in Spaces\">\n</a>\n\n![cogsgpt-demo](./docs/imgs/cogsgpt-demo.png)\n\n*If you find this repo useful, please consider giving it a star! :)*\n\n## Updates\n- [2023.04.28] **Now you can go to [CogsGPT on Hugging Face Space](https://huggingface.co/spaces/whiskyboy/CogsGPT) to experience the full capabilities of CogsGPT!!!** We are offering an Azure Cognitive Service resource for FREE to use in the demo. All you need is an OpenAI API key to get started chatting with CogsGPT!\n- [2023.04.25] CogsGPT now supports **image** type output! You can ask CogsGPT to crop a thumbnail of an image, or remove its background.\n- [2023.04.18] Release the first version of CogsGPT!\n\n## Overview\n\n### What is Azure Cognitive Service\n*(Answered by ChatGPT)*\n\n> Azure Cognitive Services is a collection of pre-built machine learning models that developers can use to add intelligent features to their applications without requiring extensive knowledge of data science or machine learning. These services include vision, speech, language, and decision-making capabilities, such as text translation, speech recognition, image recognition, and sentiment analysis. Azure Cognitive Services allows developers to quickly and easily incorporate advanced AI features into their applications, reducing the time and cost of building such features from scratch. It also provides enterprise-level security, scalability, and availability for applications that require high levels of reliability and performance.\n\n### What is CogsGPT\nCogsGPT is a conversational system which utilizes the ChatGPT model as the controller and integrates with Azure Cognitive Services as collaborative executors to achieve multimodal capabilities to some extent. Using CogsGPT, you can simply access Azure Cognitive Services via natural language to process image or audio inputs, without any knowledge of the underlying APIs. You can even ask CogsGPT to perform some complex tasks such as summarizing a long speech into a short audio clip while retaining the main information. CogsGPT will automatically decide which services to use and how to use them to achieve the goal.\n\nYou can find the list of pre-built services supported by CogsGPT [here](./cogsgpt/metas/task_metas.yaml).\n\n### How does CogsGPT work\n\nThe workflow of CogsGPT consists of three stages:\n1. Task Planing Stage: In this stage, CogsGPT will leverage ChatGPT to parse user's input into a sequence of Azure Cognitive Service tasks which have the most potentials to solve user's request. Each task may depend on the execution result of previous tasks.\n2. Task Execution Stage: In this stage, CogsGPT will execute the tasks sequentially. The execution results will be stored for future reference.\n3. Response Generation Stage: In this stage, CogsGPT will leverage ChatGPT again to generate a final response to user's request based on the execution results of the second stage. The response may be a text, an image, an audio, or a combination of them.\n\n## Getting Started\n\n### Prerequisites\n\n- Python 3.8+\n- OpenAI API key\n- Azure Cognitive Multi-Services resource ([How to deploy](https://learn.microsoft.com/en-us/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Canomaly-detector%2Clanguage-service%2Ccomputer-vision%2Clinux#create-a-new-azure-cognitive-services-resource))\n- Set the following environment variables:\n    ```bash\n    # OpenAI\n    export OPENAI_API_TYPE=\"openai\"\n    export OPENAI_API_KEY=\"<OpenAI API Key>\"\n\n    # Azure Cognitive Service\n    export COGS_ENDPOINT=\"<Azure Cognitive Service Endpoint>\"\n    export COGS_KEY=\"<Azure Cognitive Service Key>\"\n    export COGS_REGION=\"<Azure Cognitive Service Region>\"\n    ```\n\n### Quick Install\n\n```bash\npip install cogsgpt\n```\n\n### Usage\n\nYou can use CogsGPT in your own application to process image or audio inputs within three lines of codes:\n```python\nfrom cogsgpt import CogsGPT\n\nagent = CogsGPT(model_name=\"gpt-3.5-turbo\")\nagent.chat(\"What's the content in a.jpg?\")\n```\n\nFor more details of the usage, please refer to the [API Reference](https://whiskyboy.github.io/cogsgpt/awesome_chat.html)\n\n### Gradio Demo\n\nThe CogsGPT Gradio demo is now available on [Hugging Face Space](https://huggingface.co/spaces/whiskyboy/CogsGPT)! To make it easier and more affordable to try out the capabilities of CogsGPT, we are offering an Azure Cognitive Service resource for FREE to use in the demo! All you need is an OpenAI API key to get started chatting with CogsGPT!\n\nYou can also use the following commands to run the demo locally with your own Azure Cognitive Service resources (Don't forget to set the environment variables first!):\n```bash\npip install gradio\npython app.py\n```\n\nNow open your favorite browser and ENJOY YOUR CHAT!\n\n## Acknowledgment\n\nThis project is inspired by [HuggingGPT](https://github.com/microsoft/JARVIS), and is built on top of [LangChain](https://github.com/hwchase17/langchain).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n## Contributing\n\nAs an open source project, we welcome contributions and suggestions. Please follow the [fork and pull request](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) workflow to contribute to this project. Please do not try to push directly to this repo unless you are maintainer.\n\n## Contact\n\nIf you have any questions, please feel free to contact us via <weitian.bnu@gmail.com>\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Tian Wei  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A multi-modal LLM integrated ChatGPT with Azure Cognitive Service",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/whiskyboy/cogsgpt"
    },
    "split_keywords": [
        "chatgpt",
        "cognitive service",
        "llm"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "56a7271db15f95deb03c9bc806bee91f6393e3c5b6e01f422cf50521438ab9b7",
                "md5": "82212ed9b33d10760eeb4443bb3311dc",
                "sha256": "e724bc204c90050050fad5b50477d785fb270cdadf12f0c886997a2b2b73e9ca"
            },
            "downloads": -1,
            "filename": "cogsgpt-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "82212ed9b33d10760eeb4443bb3311dc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 27633,
            "upload_time": "2023-05-05T05:10:58",
            "upload_time_iso_8601": "2023-05-05T05:10:58.148132Z",
            "url": "https://files.pythonhosted.org/packages/56/a7/271db15f95deb03c9bc806bee91f6393e3c5b6e01f422cf50521438ab9b7/cogsgpt-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d68c15378f85e9d5433141fb28129371a6b3b40d84052b40b8325032e866f6c",
                "md5": "b1d5f034c6da360c7d56c543b1bd844e",
                "sha256": "5c4da400eaa15dea59a5863552f145ad55682fa5dd857bbe5d9944f14e256fda"
            },
            "downloads": -1,
            "filename": "cogsgpt-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b1d5f034c6da360c7d56c543b1bd844e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 25629,
            "upload_time": "2023-05-05T05:10:59",
            "upload_time_iso_8601": "2023-05-05T05:10:59.563312Z",
            "url": "https://files.pythonhosted.org/packages/0d/68/c15378f85e9d5433141fb28129371a6b3b40d84052b40b8325032e866f6c/cogsgpt-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-05 05:10:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "whiskyboy",
    "github_project": "cogsgpt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cogsgpt"
}
        
Elapsed time: 0.11911s