Query the ChatGPT API from anywhere! This simple wrapper can be used as a Plugin for the awesome Wox launcher. Uses Flask to display the results in a ChatGPT-themed locally-hosted webpage. Only tested on Windows with Python 3.10.
- Clone the repo:
git clone https://www.github.com/Mnikley/Wox.Plugin.ChatGPT - Install requirements:
pip install -r requirements.txt - Get an OpenAI API key: https://platform.openai.com/account/api-keys
- Open and edit
app.pyto enter your API key:
config = {
"api_key": "place-your-api-key-here",
..
}
- Copy the entire folder
Wox.Plugin.ChatGPTto your WoxPluginsfolder (per default:C:\Users\MNikley\AppData\Local\Wox\app-1.4.1196\Plugins) and make sure the plugin is enabled. Restart Wox afterwards - Run queries by entering
gpt [QUERY]in your Wox launcher prompt, e.g.gpt what is love
Alternatively you can run the script directly via python app.py [QUERY]
api_key:Your OpenAI API keymodel:Used model (default:gpt-3.5-turbo, check https://platform.openai.com/docs/models/)max_tokens:Maximum amount of returned tokens (longer = more expensive; default:512)temperature:Increase randomness (default:0.15)stream:: Stream response or wait for entire processed text (default:True)price_per_token:Used for estimating costs (default:0.002 / 1000based on gpt-3.5-turbo)
- Run app:
python app.py
- Send queries via API endpoint
/openai_call/QUERY, e.g.:
http://127.0.0.1:5000/openai_call/how%20much%20is%20the%20fish

