https://github.com/simonpcouch/gander
LLMs at the tooltip
https://github.com/simonpcouch/gander
Last synced: about 2 months ago
JSON representation
LLMs at the tooltip
- Host: GitHub
- URL: https://github.com/simonpcouch/gander
- Owner: simonpcouch
- License: other
- Created: 2024-12-13T23:42:55.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-19T15:10:16.000Z (2 months ago)
- Last Synced: 2024-12-19T16:24:13.734Z (2 months ago)
- Language: R
- Homepage: https://simonpcouch.github.io/quickly/
- Size: 3.13 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.Rmd
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Support: .github/SUPPORT.md
Awesome Lists containing this project
- jimsghstars - simonpcouch/gander - High performance, low friction LLM chat for data scientists (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# gander
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://CRAN.R-project.org/package=gander)
[](https://github.com/simonpcouch/gander/actions/workflows/R-CMD-check.yaml)gander is a higher-performance and lower-friction chat experience for data scientists in RStudio and Positron. The package brings [ellmer](https://ellmer.tidyverse.org) chats into your project sessions, automatically incorporating relevant context and streaming their responses directly into your documents.
**Why not just chat?** In many ways, working with gander is just like using a chat interface online or via [shinychat](https://github.com/jcheng5/shinychat). The gander assistant will automatically find the context it needs, though:
* File contents from elsewhere in the project you're working on (e.g. the lines in your source file)
* Variables, allowing the assistant to locate the column names and types in data frames you're working with, images linked to in your documents, and function definitions
* Function documentation, either defined in your project or from common R packages## Installation
You can install gander like so:
``` r
pak::pak("simonpcouch/gander")
```Then, ensure that you have an [`ANTHROPIC_API_KEY`](https://console.anthropic.com/) environment variable set, and you're ready to go. If you'd like to use an LLM other than Anthropic's Claude 3.5 Sonnet—like OpenAI's ChatGPT or a local ollama model—to power the gander see `?gander_options`.
The gander assistant is interfaced with the via the gander addin. For easiest access, we recommend registering the gander addin to a keyboard shortcut.
**In RStudio**, navigate to `Tools > Modify Keyboard Shortcuts > Search "gander"`—we suggest `Ctrl+Alt+G` (or `Ctrl+Cmd+G` on macOS).
**In Positron**, you'll need to open the command palette, run "Open Keyboard Shortcuts (JSON)", and paste the following into your `keybindings.json`:
```json
{
"key": "Ctrl+Cmd+G",
"command": "workbench.action.executeCode.console",
"when": "editorTextFocus",
"args": {
"langId": "r",
"code": "gander::gander_addin()",
"focus": true
}
}
```The analogous keybinding on non-macOS is `Ctrl+Alt+G`. That said, change the `"key"` entry to any keybinding you wish!
Once those steps are completed, you're ready to use the gander assistant with a keyboard shortcut.
## Example
[](https://github.com/user-attachments/assets/563f4670-860a-4f8f-a087-41c28381b977)