You'll need the latest version of ellmer:
pak::pak("ellmer")
You'll also need to set up at least one chat provider. If you don't already have an API account (a paid subscription unfortunately doesn't count), we recommend either Claude or Gemini. Claude is cheap and good at R code, while gemini is free and good at videos. Follow the instructions below to configure one.
- Sign up at https://console.anthropic.com.
- Load up enough credit to buy a coffee.
- Create a key at https://console.anthropic.com/settings/keys and copy it to the clipboard.
usethis::edit_r_environ()
.- Add a new line containing:
ANTHROPIC_API_KEY={paste}
. - Restart R.
- Check that
ellmer::chat_anthropic()$chat("Tell me a joke")
works.
- Log in to https://aistudio.google.com with a google account
- Click create API key & copy it to the clipboard.
usethis::edit_r_environ()
- Add a new line containing:
GOOGLE_API_KEY={paste}
- Restart R.
- Check that
ellmer::chat_google_gemini()$chat("Tell me a joke")
works.