Skip to contents

The goal of buggy is to help users understand and address error messages using LLMs. With the tool enabled, errors raised to the user are accompanied by clickable links to “explain” or “fix” the issue. Explanations are printed to the console while fixes implement changes directly; in both cases, the model is supplied context about the files you’re working in and the functions you’re working with.

Installation

You can install the development version of buggy like so:

pak::pak("simonpcouch/buggy")

To enable buggy, call buggy::buggy_enable(). To always have buggy enabled every time you start R, you could add buggy::buggy_enable() to your .Rprofile, perhaps with usethis::edit_r_profile().

Example

In the following example, I make a mistake when plotting mtcars:

A screencast of a Positron session. A script called example.R is open in the editor with some ggplot2 lines, one of which will cause an error. Running the code results in both an error and a note Click to explain or fix the last error.

Upon seeing the error, I click the “explain” link and, after wrapping my head around the issue, allow the model to “fix” it. Once the model fixes the code, it runs correctly.

Thanks

I’d tossed this package idea around with various folks over the last few months before deciding to give it a go: namely, Barret Schloerke and Joshua Yamamoto.