OpenAI_AHK_quick_chat is an AutoHotkey (AHK) script that integrates GPT-3 AI from OpenAI for any input field on your computer. It's a simple tool to send queries to the GPT-3 model and get responses in your clipboard.
I have only tested with Windows!! feedback is welcome
- Install AutoHotkey from here.
- Clone or download this repository and unzip the file.
- Double-click the 'GPT3-AHK.ahk' file.
- Generate an OpenAI API key following this instruction
- When prompted, input your OpenAI API key. The script will not function without an API key.
- The default shortcut to invoke the script is
Alt + Left Click
. - Once invoked, your clipboard contents will be filled into the text box.
- Select an agent and write your message, then press
OK
.- Choose
Try Again
to continue the conversation - previous messages are 'remembered'. - Select
Cancel
to close the dialogue window - AI response is in your clipboard. - Select
Continue
to close the dialogue window - AI response is in your clipboard and auto pasted .
- Choose
To change your API key or modify the shortcut key, edit the 'settings.ini' file with a text editor.
To create or modify agents, edit the 'agents.ini' file. When adding a new agent:
- Assign a unique number to 'Name', 'SystemMsg', and 'Temperature' values.
- Update the 'ListLength' value to equal the number of agents (this is a bit of a janky workaround, sorry)
To exit or reload the script after making changes, look for the robot icon in your system tray.
The main script is GPT3-AHK.ahk
. Here are the key parts of the script:
#SingleInstance
: This line ensures that only one instance of the script is running at a time.MODEL_ID
,MODEL_MAX_TOKENS
,MODEL_TEMP
: These variables define the model to be used, the maximum tokens generated in the response, and the sampling temperature respectively.MY_HOTKEY
: This variable sets the shortcut key for the script.http := WinHttpRequest()
: This line initializes an HTTP request.RunGPTAgent
andAgainGPTAgent
: These are the main commands that handle the interaction with the GPT-3 model.SetSystemCursor
andRestoreCursors
: These functions manage the system cursor during the script's operation.
The script uses the following dependencies:
WinHttpRequest
: An HTTP request module. Learn more here.cJson.ahk
: A JSON library for AutoHotkey. Access it here.
This project was modified by liamgwallace from GPT3-AHK originaly by htadashi. It is available here. Please review the code and contribute if you wish.