Skip to content

Commit

Permalink
link to site in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Oct 7, 2024
1 parent a2f4e80 commit 16a316c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
10 changes: 4 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,23 @@ Then, ensure that you have an [`ANTHROPIC_API_KEY`](https://console.anthropic.co

## Example

To create a pal, simply pass `pal()` a pre-defined "role" and a keybinding you'd like it attached to. For example, to use the cli pal:
To create a pal, simply pass `pal()` a pre-defined "role" and a keybinding you'd like it attached to. For example, to use the [cli pal](https://simonpcouch.github.io/pal/reference/pal_cli.html):

```r
pal("cli", "Ctrl+Shift+C")
```

Then, highlight some code, press the keyboard shortcut, and watch your code be rewritten:

![](inst/figs/addin.gif)
![](https://github.com/simonpcouch/pal/raw/main/inst/figs/addin.gif)
As-is, the package provides ergonomic LLM assistants for R package development:

* `"cli"`: Convert to cli
* `"cli"`: [Convert to cli](https://simonpcouch.github.io/pal/reference/pal_cli.html)
* `"testthat"`: Convert to testthat 3
* `"roxygen"`: Document functions with roxygen

That said, the package provides infrastructure for others to make LLM assistants for any task in R, from authoring to interactive data analysis. With only a markdown file and a function call, users can extend pal to assist with their own repetitive but hard-to-automate tasks.

## How much do pals cost?

The cost of using pals depends on 1) the length of the underlying prompt for a given pal and 2) the cost per token of the chosen model. Using the cli pal with Anthropic's Claude Sonnet 3.5, for example, costs something like \$15 per 1,000 code refactorings, while using the testthat pal with OpenAI's GPT 4o-mini would cost something like \$1 per 1,000 refactorings. Pals using a locally-served LLM are "free" (in the usual sense of code execution, ignoring the cost of increased battery usage).

<!-- TODO: link to `cli_pal` here. -->
The cost of using pals depends on 1) the length of the underlying prompt for a given pal and 2) the cost per token of the chosen model. Using the cli pal with Anthropic's Claude Sonnet 3.5, for example, [costs something like](https://simonpcouch.github.io/pal/reference/pal_cli.html#cost) \$15 per 1,000 code refactorings, while using the testthat pal with OpenAI's GPT 4o-mini would cost something like \$1 per 1,000 refactorings. Pals using a locally-served LLM are "free" (in the usual sense of code execution, ignoring the cost of increased battery usage).
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ power the pal, see `?pal()` to set default metadata on that model.
## Example

To create a pal, simply pass `pal()` a pre-defined “role” and a
keybinding you’d like it attached to. For example, to use the cli pal:
keybinding you’d like it attached to. For example, to use the [cli
pal](https://simonpcouch.github.io/pal/reference/pal_cli.html):

``` r
pal("cli", "Ctrl+Shift+C")
Expand All @@ -48,10 +49,12 @@ pal("cli", "Ctrl+Shift+C")
Then, highlight some code, press the keyboard shortcut, and watch your
code be rewritten:

![](inst/figs/addin.gif) As-is, the package provides ergonomic LLM
assistants for R package development:
![](https://github.com/simonpcouch/pal/raw/main/inst/figs/addin.gif)
As-is, the package provides ergonomic LLM assistants for R package
development:

- `"cli"`: Convert to cli
- `"cli"`: [Convert to
cli](https://simonpcouch.github.io/pal/reference/pal_cli.html)
- `"testthat"`: Convert to testthat 3
- `"roxygen"`: Document functions with roxygen

Expand All @@ -65,10 +68,10 @@ tasks.

The cost of using pals depends on 1) the length of the underlying prompt
for a given pal and 2) the cost per token of the chosen model. Using the
cli pal with Anthropic’s Claude Sonnet 3.5, for example, costs something
like \$15 per 1,000 code refactorings, while using the testthat pal with
cli pal with Anthropic’s Claude Sonnet 3.5, for example, [costs
something
like](https://simonpcouch.github.io/pal/reference/pal_cli.html#cost)
\$15 per 1,000 code refactorings, while using the testthat pal with
OpenAI’s GPT 4o-mini would cost something like \$1 per 1,000
refactorings. Pals using a locally-served LLM are “free” (in the usual
sense of code execution, ignoring the cost of increased battery usage).

<!-- TODO: link to `cli_pal` here. -->

0 comments on commit 16a316c

Please sign in to comment.