/setup_chattr_in_RStudio.R Secret
Created
June 30, 2024 13:52
Setup file for using ChatGPT in RStudio
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
##################################################################### | |
# Source: https://mlverse.github.io/chattr/articles/openai-gpt.html | |
##################################################################### | |
# Insert your personal OpenAI secret key to autheticate the chattr app | |
Sys.setenv("OPENAI_API_KEY" = "####################") | |
##################################################################### | |
# Source: https://mlverse.github.io/chattr/ | |
##################################################################### | |
# Install the remotes package if not already installed | |
if (!require(remotes)) { | |
install.packages("remotes") | |
} | |
# Install the chattr package (from GitHub) if not already installed | |
if (!require(chattr)) { | |
remotes::install_github("mlverse/chattr") | |
} | |
# Select the model back-end you with to use (copilot/gpt35/gpt4/llamagpt) | |
chattr::chattr_use("gpt4") | |
# Run the chattr app in the RStudio Viewer pane by default | |
chattr::chattr_app() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment