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(config): add functionality to require first token #4

Merged
merged 1 commit into from
Jun 11, 2023
Merged

Conversation

25077667
Copy link
Owner

This commit adds a new function init_first_token() which is called only when the user is using cg at the first time and they didn't give it any token. The function requires the user to provide a token for cg by printing instructions on how to obtain one from https://beta.openai.com/account/api-keys. If no tokens are present in the configuration file, this function will be called automatically.

The Config class has also been updated so that if there are no tokens present in the configuration file, it will append a newly obtained token from init_first_token() before writing out to disk.

This change improves usability for users who have not yet set up their OpenAI API key with CG.

This commit adds a new function `init_first_token()` which is called only when the user is using cg at the first time and they didn't give it any token. The function requires the user to provide a token for cg by printing instructions on how to obtain one from https://beta.openai.com/account/api-keys. If no tokens are present in the configuration file, this function will be called automatically.

The `Config` class has also been updated so that if there are no tokens present in the configuration file, it will append a newly obtained token from `init_first_token()` before writing out to disk.

This change improves usability for users who have not yet set up their OpenAI API key with CG.
@25077667 25077667 merged commit 7e9730e into main Jun 11, 2023
@25077667 25077667 deleted the dev branch June 11, 2023 18:40
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.

1 participant