-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69701c1
commit 589c383
Showing
16 changed files
with
584 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# ubep.gpt (development version) | ||
|
||
* Added zzz.R with startup messages checking for API keys. | ||
* Update README with examples of usage. | ||
* Setup development environment. | ||
* Initial setup from CorradoLanera/gpt-template. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,42 @@ | ||
.onAttach <- function(...) { | ||
usethis::ui_info("Wellcome to ubep.gpt!") | ||
|
||
if (Sys.getenv("OPENAI_API_sKEY") == "") { | ||
usethis::ui_info("OPENAI_API_KEY environment variable is not set.") | ||
usethis::ui_info( | ||
"it is required to use OpenAI APIs with `ubep.gpt`.") | ||
usethis::ui_info( | ||
"To set the OPENAI_API_KEY environment variable, | ||
you can call {usethis::ui_code('usethis::edit_r_environ(\"project\")')}, | ||
and add the line {usethis::ui_code('OPENAI_API_KEY=<your_api_key>')}." | ||
) | ||
usethis::ui_info( | ||
"REMIND: | ||
Never share your API key with others. | ||
Keep it safe and secure. | ||
If you need an API key, you can generate it in the OpenAI-API website | ||
(https://platform.openai.com/api-keys). | ||
Remind to assign it to the correct project | ||
(i.e., NOT to the 'default' one). | ||
If you need to be added to the organization and/or to a project, | ||
please, contact your project's referent." | ||
) | ||
|
||
usethis::ui_todo( | ||
"Please, set the OPENAI_API_KEY environment variable with your OpenAI API key." | ||
) | ||
usethis::ui_todo("And than, restart your R session.") | ||
} else { | ||
usethis::ui_info("The OPENAI_API_KEY environment variable is set") | ||
usethis::ui_info("You are ready to use the package `ubep.gpt`.") | ||
usethis::ui_todo("Just, double check if the key is the correct one.") | ||
usethis::ui_info( | ||
"REMIND: Never share your API key with others. | ||
Keep it safe and secure. | ||
If you think that your API key was compromised, | ||
you can regenerate it in the OpenAI-API website | ||
(https://platform.openai.com/api-keys)." | ||
) | ||
usethis::ui_done("Enjoy the package!") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.