if (FALSE) {
# Option 1: Auto-detect available API (OpenAI or Gemini)
# Select some text in RStudio and then run the rstudio addins
addCommentCode(Model = "gpt-4o-mini", language = "English", SelectedCode = TRUE)
# Option 2: Explicitly use OpenAI
addCommentCode(Model = "gpt-4o-mini", provider = "openai", SelectedCode = TRUE)
# Option 3: Use Gemini API
addCommentCode(Model = "gemini-2.0-flash", provider = "gemini", SelectedCode = TRUE)
# Option 4: Copy text to clipboard and execute
addCommentCode(Model = "gpt-4o-mini", language = "English", SelectedCode = FALSE)
}
Run the code above in your browser using DataLab