retico-chatgpt


Nameretico-chatgpt JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/retico-team/retico-chatgpt
SummaryThe chatgpt incremental module for the retico framework
upload_time2023-04-15 16:41:31
maintainer
docs_urlNone
authorThilo Michael
requires_python>=3.6, <4
license
keywords retico framework incremental dialogue dialog chat gpt openai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # retico-chatgpt

A module that uses OpenAI's GPT-3 to generate responses to user input incrementally.

## Example

```python
import retico_core
import retico_wav2vecasr
import retico_chatgpt
import dotenv

dotenv.load_dotenv()

INSTRUCTIONS = """You are an AI assistant that is an expert in alcoholic beverages.
You know about cocktails, wines, spirits and beers.
You can provide advice on drink menus, cocktail ingredients, how to make cocktails, and anything else related to alcoholic drinks.
If you are unable to provide an answer to a question, please respond with the phrase "I'm just a simple barman, I can't help with that."
Please aim to be as helpful, creative, and friendly as possible in all of your responses.
Do not use any external URLs in your answers. Do not refer to any blogs in your answers.
You are interacting with spoken words. Be very brief and do not format your responses.
Do not use dashes in lists, and do not use any other formatting.
Write out numbers as words, for example use "one" instead of "1".
"""

mic = retico_core.audio.MicrophoneModule()
asr = retico_wav2vecasr.Wav2VecASRModule(language="en")
chatgpt = retico_chatgpt.ChatGPTDialogueModule(system_prompt=INSTRUCTIONS)
printer = retico_core.debug.TextPrinterModule()

mic.subscribe(asr)
asr.subscribe(chatgpt)
chatgpt.subscribe(printer)

retico_core.network.run(mic)

print("Network is running")
input()

retico_core.network.stop(mic)
```

For this example, either the environment variable `OPENAI_API_KEY` needs to be set or a `.env` file needs to be present in the current working directory with the following content:

```bash
OPENAI_API_KEY=<your-openai-api-key>
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/retico-team/retico-chatgpt",
    "name": "retico-chatgpt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6, <4",
    "maintainer_email": "",
    "keywords": "retico,framework,incremental,dialogue,dialog,chat,gpt,openai",
    "author": "Thilo Michael",
    "author_email": "uhlomuhlo@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/52/72/abf25a95e42d96035d71c541f2c69074121f4ff8ce02fc321936324ad3f8/retico-chatgpt-0.0.1.tar.gz",
    "platform": null,
    "description": "# retico-chatgpt\n\nA module that uses OpenAI's GPT-3 to generate responses to user input incrementally.\n\n## Example\n\n```python\nimport retico_core\nimport retico_wav2vecasr\nimport retico_chatgpt\nimport dotenv\n\ndotenv.load_dotenv()\n\nINSTRUCTIONS = \"\"\"You are an AI assistant that is an expert in alcoholic beverages.\nYou know about cocktails, wines, spirits and beers.\nYou can provide advice on drink menus, cocktail ingredients, how to make cocktails, and anything else related to alcoholic drinks.\nIf you are unable to provide an answer to a question, please respond with the phrase \"I'm just a simple barman, I can't help with that.\"\nPlease aim to be as helpful, creative, and friendly as possible in all of your responses.\nDo not use any external URLs in your answers. Do not refer to any blogs in your answers.\nYou are interacting with spoken words. Be very brief and do not format your responses.\nDo not use dashes in lists, and do not use any other formatting.\nWrite out numbers as words, for example use \"one\" instead of \"1\".\n\"\"\"\n\nmic = retico_core.audio.MicrophoneModule()\nasr = retico_wav2vecasr.Wav2VecASRModule(language=\"en\")\nchatgpt = retico_chatgpt.ChatGPTDialogueModule(system_prompt=INSTRUCTIONS)\nprinter = retico_core.debug.TextPrinterModule()\n\nmic.subscribe(asr)\nasr.subscribe(chatgpt)\nchatgpt.subscribe(printer)\n\nretico_core.network.run(mic)\n\nprint(\"Network is running\")\ninput()\n\nretico_core.network.stop(mic)\n```\n\nFor this example, either the environment variable `OPENAI_API_KEY` needs to be set or a `.env` file needs to be present in the current working directory with the following content:\n\n```bash\nOPENAI_API_KEY=<your-openai-api-key>\n```\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "The chatgpt incremental module for the retico framework",
    "version": "0.0.1",
    "split_keywords": [
        "retico",
        "framework",
        "incremental",
        "dialogue",
        "dialog",
        "chat",
        "gpt",
        "openai"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5272abf25a95e42d96035d71c541f2c69074121f4ff8ce02fc321936324ad3f8",
                "md5": "8aa5ddb3668b2cc50c1575971bef353c",
                "sha256": "f6699a6d77b6c504efd95c4ace67e70c51afef6a723a45dd2c7c0f5d2205d706"
            },
            "downloads": -1,
            "filename": "retico-chatgpt-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8aa5ddb3668b2cc50c1575971bef353c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6, <4",
            "size": 8863,
            "upload_time": "2023-04-15T16:41:31",
            "upload_time_iso_8601": "2023-04-15T16:41:31.898944Z",
            "url": "https://files.pythonhosted.org/packages/52/72/abf25a95e42d96035d71c541f2c69074121f4ff8ce02fc321936324ad3f8/retico-chatgpt-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-15 16:41:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "retico-team",
    "github_project": "retico-chatgpt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "retico-chatgpt"
}
        
Elapsed time: 0.20088s