-
Notifications
You must be signed in to change notification settings - Fork 2
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
Need to input API key at each query, despite setting API key using command #1
Comments
@quadrismegistus Thanks for the feedback! |
Here's the channel output, before and after running the Set OpenAPI Key command. That command appeared to make no effect on the output; not sure if it actually runs.
|
@quadrismegistus The extension uses SecretStorage to store the OpenAI API key. The author of the SecretStorage API says it is built on http://github.com/atom/node-keytar.
Perhaps the problem lies in the limitations of your OS. In the latest release of the extension, I added logging of the API key saving error, if such occurs. Please update the extension and re-view the output. Perhaps the reason will become clear. |
Thanks for your help. I re-installed the extension (wasn't sure how else to ensure it had updated), and then restarted VSCode, ran "Set API key" command and then ran a "Generate docstring command". The Set API key command still made no effect on the logs (though there may have been no error?). The "generate docstring" command then asked me for my key again at which time it sent the request to the server and gave back the response. Subsequent use of "generate docstring" asks for API key again. I wonder if there's a way one could provide a path or set an environment variable as an alternative way of storing the key? Here's the full output of the debug console:
Note: The examples provided are for illustrative purposes only and may not reflect the actual output of the function.
|
I apologize for the delay in reply. Obviously, the problem is either VSCode or the node-keytar package that it uses to store secrets. I suggest checking node-keytar directly. To do this, I created a simple script that first saves the secret, then gets.
"qwerty" should be displayed in the terminal. |
Will be added saving the OpenAI API key in memory. This is necessary if the key cannot be saved in the `SecretStorage`. Refs: #1
In the new release (0.3.1), I added saving the key to memory. Now you don't need to enter the key every time you generate a docstring. However, since it is not stored in SecretStorage, you will need to enter the key again after each restart of VSCode. I will still ask you to run the script from my previous post to understand why it is not stored in your SecretStorage. |
Just a quick issue to document. Maybe I'm doing something wrong but I can't get the extension to remember my API key.
The text was updated successfully, but these errors were encountered: