chatgpt-voice-assistant


Namechatgpt-voice-assistant JSON
Version 2.0.1 PyPI version JSON
download
home_pageNone
SummaryPackage to speak with OpenAI's GPT models
upload_time2025-02-04 01:26:38
maintainerNone
docs_urlNone
authorJake Cyr
requires_python<4.0,>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ChatGPT Voice Assistant

![GitHub Actions Build Status](https://github.com/jakecyr/openai-gpt3-chatbot/actions/workflows/test-application.yml/badge.svg)

A simple interface to the OpenAI ChatGPT model with speech to text for input and text to speech for the output.
chatgpt-voice-assistant uses OpenAI Whisper for speech transcription and OpenAI Speech Generation for TTS.

## Setup

### Mac Prerequisites

Install dependencies:

```bash
brew install portaudio
brew link portaudio
```

Update your pydistutils config file for portaudio usage by running the following:

```bash
echo "[build_ext]" >> $HOME/.pydistutils.cfg
echo "include_dirs="`brew --prefix portaudio`"/include/" >> $HOME/.pydistutils.cfg
echo "library_dirs="`brew --prefix portaudio`"/lib/" >> $HOME/.pydistutils.cfg
```

### Install from PyPI

Run the following to install the `chatgpt-assist` CLI application:

```bash
pip install chatgpt-voice-assistant
```

### Install from Source

1. Install poetry ([official docs](https://python-poetry.org/docs/#installation) or with `pip install poetry`)
2. Install all dependencies with `poetry install`

## Running the Script

Either set the `OPENAI_API_KEY` environment variable before running the script or pass in your secret key to the script like in the example below:

```bash
export OPENAI_API_KEY=<OPEN API SECRET KEY HERE>
gptassist

# OR

gptassist --open-ai-key=<OPEN API SECRET KEY HERE>
```

or if installed from source with poetry:

```bash
poetry run gptassist --open-ai-key=<OPEN API SECRET KEY HERE>
```

Start speaking and turn up your volume to hear the AI assistant respond.

Say the word "exit" or hit Ctrl+C in your terminal to stop the application.

### Options

Below is the help menu from the chatgpt-assist CLI detailing all available options:

```txt
-h, --help
    show this help message and exit

--log-level LOG_LEVEL
    Whether to print at the debug level or not.

--input-device-name INPUT_DEVICE_NAME
    The input device name.

--lang LANG
    The language to listen for when running speech to text (ex. en or fr).

--max-tokens MAX_TOKENS
    Max OpenAI completion tokens to use for text generation.

--tld TLD
    Top level domain (ex. com or com.au).

--safe-word SAFE_WORD
    Word to speak to exit the application.

--wake-word WAKE_WORD
    (Optional) Word to trigger a response.

--open-ai-key OPEN_AI_KEY
    Required. Open AI Secret Key (or set OPENAI_API_KEY environment variable)

--tts {apple,google,openai}
    Choose a text-to-speech engine.

--speech-rate SPEECH_RATE
    The rate at which to play speech. 1.0=normal
```

### Specifying an Output Language Accent

Specify both the `LANGUAGE` and `TOP_LEVEL_DOMAIN` vars to override the default English (United States)

```bash
gptassist --open-ai-key=<OPENAI_KEY> --lang=en --tld=com
```

#### Language Examples

- English (United States) _DEFAULT_
  - `LANGUAGE=en TOP_LEVEL_DOMAIN=com`
- English (Australia)
  - `LANGUAGE=en TOP_LEVEL_DOMAIN=com.au`
- English (India)
  - `LANGUAGE=en TOP_LEVEL_DOMAIN=co.in`
- French (France)
  - `LANGUAGE=fr TOP_LEVEL_DOMAIN=fr`

See Localized 'accents' section on gTTS docs for more information

## References

* [Speech Recognition library docs](https://pypi.org/project/SpeechRecognition/1.2.3)
* [Google Translate Text-to-Speech API (gTTS)](https://gtts.readthedocs.io/en/latest/module.html#)


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "chatgpt-voice-assistant",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Jake Cyr",
    "author_email": "cyrjake@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0f/4e/c19ed1c6433245e326b7b4e787bd7f4c42d89ffdb089c83df73bfc163f55/chatgpt_voice_assistant-2.0.1.tar.gz",
    "platform": null,
    "description": "# ChatGPT Voice Assistant\n\n![GitHub Actions Build Status](https://github.com/jakecyr/openai-gpt3-chatbot/actions/workflows/test-application.yml/badge.svg)\n\nA simple interface to the OpenAI ChatGPT model with speech to text for input and text to speech for the output.\nchatgpt-voice-assistant uses OpenAI Whisper for speech transcription and OpenAI Speech Generation for TTS.\n\n## Setup\n\n### Mac Prerequisites\n\nInstall dependencies:\n\n```bash\nbrew install portaudio\nbrew link portaudio\n```\n\nUpdate your pydistutils config file for portaudio usage by running the following:\n\n```bash\necho \"[build_ext]\" >> $HOME/.pydistutils.cfg\necho \"include_dirs=\"`brew --prefix portaudio`\"/include/\" >> $HOME/.pydistutils.cfg\necho \"library_dirs=\"`brew --prefix portaudio`\"/lib/\" >> $HOME/.pydistutils.cfg\n```\n\n### Install from PyPI\n\nRun the following to install the `chatgpt-assist` CLI application:\n\n```bash\npip install chatgpt-voice-assistant\n```\n\n### Install from Source\n\n1. Install poetry ([official docs](https://python-poetry.org/docs/#installation) or with `pip install poetry`)\n2. Install all dependencies with `poetry install`\n\n## Running the Script\n\nEither set the `OPENAI_API_KEY` environment variable before running the script or pass in your secret key to the script like in the example below:\n\n```bash\nexport OPENAI_API_KEY=<OPEN API SECRET KEY HERE>\ngptassist\n\n# OR\n\ngptassist --open-ai-key=<OPEN API SECRET KEY HERE>\n```\n\nor if installed from source with poetry:\n\n```bash\npoetry run gptassist --open-ai-key=<OPEN API SECRET KEY HERE>\n```\n\nStart speaking and turn up your volume to hear the AI assistant respond.\n\nSay the word \"exit\" or hit Ctrl+C in your terminal to stop the application.\n\n### Options\n\nBelow is the help menu from the chatgpt-assist CLI detailing all available options:\n\n```txt\n-h, --help\n    show this help message and exit\n\n--log-level LOG_LEVEL\n    Whether to print at the debug level or not.\n\n--input-device-name INPUT_DEVICE_NAME\n    The input device name.\n\n--lang LANG\n    The language to listen for when running speech to text (ex. en or fr).\n\n--max-tokens MAX_TOKENS\n    Max OpenAI completion tokens to use for text generation.\n\n--tld TLD\n    Top level domain (ex. com or com.au).\n\n--safe-word SAFE_WORD\n    Word to speak to exit the application.\n\n--wake-word WAKE_WORD\n    (Optional) Word to trigger a response.\n\n--open-ai-key OPEN_AI_KEY\n    Required. Open AI Secret Key (or set OPENAI_API_KEY environment variable)\n\n--tts {apple,google,openai}\n    Choose a text-to-speech engine.\n\n--speech-rate SPEECH_RATE\n    The rate at which to play speech. 1.0=normal\n```\n\n### Specifying an Output Language Accent\n\nSpecify both the `LANGUAGE` and `TOP_LEVEL_DOMAIN` vars to override the default English (United States)\n\n```bash\ngptassist --open-ai-key=<OPENAI_KEY> --lang=en --tld=com\n```\n\n#### Language Examples\n\n- English (United States) _DEFAULT_\n  - `LANGUAGE=en TOP_LEVEL_DOMAIN=com`\n- English (Australia)\n  - `LANGUAGE=en TOP_LEVEL_DOMAIN=com.au`\n- English (India)\n  - `LANGUAGE=en TOP_LEVEL_DOMAIN=co.in`\n- French (France)\n  - `LANGUAGE=fr TOP_LEVEL_DOMAIN=fr`\n\nSee Localized 'accents' section on gTTS docs for more information\n\n## References\n\n* [Speech Recognition library docs](https://pypi.org/project/SpeechRecognition/1.2.3)\n* [Google Translate Text-to-Speech API (gTTS)](https://gtts.readthedocs.io/en/latest/module.html#)\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Package to speak with OpenAI's GPT models",
    "version": "2.0.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b8e6785c2d64ec5bc46116472745ae47f93e652324eda380c6976014904fd8b",
                "md5": "6e71137b868423de9689ece06a8e7bda",
                "sha256": "3539998cae14e61979e496dd774d8253d01d71991706d8e23a020816821d077e"
            },
            "downloads": -1,
            "filename": "chatgpt_voice_assistant-2.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6e71137b868423de9689ece06a8e7bda",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 24287,
            "upload_time": "2025-02-04T01:26:37",
            "upload_time_iso_8601": "2025-02-04T01:26:37.581716Z",
            "url": "https://files.pythonhosted.org/packages/6b/8e/6785c2d64ec5bc46116472745ae47f93e652324eda380c6976014904fd8b/chatgpt_voice_assistant-2.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0f4ec19ed1c6433245e326b7b4e787bd7f4c42d89ffdb089c83df73bfc163f55",
                "md5": "5cebd61190f28ccdbe2d9244fb6cae91",
                "sha256": "2f533eef5f2704059885e52672e3eb063b4f21e073bd687f936affeb760548fd"
            },
            "downloads": -1,
            "filename": "chatgpt_voice_assistant-2.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "5cebd61190f28ccdbe2d9244fb6cae91",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 13694,
            "upload_time": "2025-02-04T01:26:38",
            "upload_time_iso_8601": "2025-02-04T01:26:38.852860Z",
            "url": "https://files.pythonhosted.org/packages/0f/4e/c19ed1c6433245e326b7b4e787bd7f4c42d89ffdb089c83df73bfc163f55/chatgpt_voice_assistant-2.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-04 01:26:38",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "chatgpt-voice-assistant"
}
        
Elapsed time: 0.48974s