ChatGPT.nvim
ChatGPT.nvim copied to clipboard
feat: handle limited time key, Lua function for obtaining keys
This PR addresses 3 items.
- Allow users to use Lua functions to provide keys (in addition to current methods)
- Allow timeouts to be specified for keys. Automatically request new keys when it expires
- A bug fix in handling stream
Lua function is self explanatory. The README has been updated to reflect it and also with an example that I'm using personally. The change is simple also. It is a 2 line change in loadConfigFromCommand()
The timeout handling is bit complicated. Every time the ChatGPT API's is used, the key is validated before executing the command. To achieve this, some code had to be refactored.
The third one is shown by below two screen shots with and without the fix.
Without the fix.
With the fix.