Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle limited time key, Lua function for obtaining keys #407

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

rameshsanth
Copy link

This PR addresses 3 items.

  1. Allow users to use Lua functions to provide keys (in addition to current methods)
  2. Allow timeouts to be specified for keys. Automatically request new keys when it expires
  3. 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.
Screenshot 2024-03-18 at 7 45 03 PM

With the fix.
Screenshot 2024-03-18 at 7 42 49 PM

feat: Handle key timeout
fix: missing data in handling stream data
@rameshsanth rameshsanth changed the title Handle limited time key, Lua function for obtaining keys feat: handle limited time key, Lua function for obtaining keys Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants