Skip to content

Mnikley/Wox.Plugin.ChatGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wox launcher ChatGPT Plugin

logo2

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.

Screenshots

chatgpt_wox_plugin

Quickstart

  1. Clone the repo: git clone https://www.github.com/Mnikley/Wox.Plugin.ChatGPT
  2. Install requirements: pip install -r requirements.txt
  3. Get an OpenAI API key: https://platform.openai.com/account/api-keys
  4. Open and edit app.py to enter your API key:
config = {
    "api_key": "place-your-api-key-here",
    ..
}
  1. Copy the entire folder Wox.Plugin.ChatGPT to your Wox Plugins folder (per default: C:\Users\MNikley\AppData\Local\Wox\app-1.4.1196\Plugins) and make sure the plugin is enabled. Restart Wox afterwards
  2. 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]

Configuration

  • api_key: Your OpenAI API key
  • model: 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 / 1000 based on gpt-3.5-turbo)

Run via command line

  1. Run app:
python app.py
  1. Send queries via API endpoint /openai_call/QUERY, e.g.:
http://127.0.0.1:5000/openai_call/how%20much%20is%20the%20fish