Skip to content

Commit

Permalink
udpate README to mention ellmer
Browse files Browse the repository at this point in the history
  • Loading branch information
romainfrancois committed Feb 9, 2025
1 parent 1af10c4 commit 7c481b2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 26 deletions.
19 changes: 11 additions & 8 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ knitr::opts_chunk$set(
<!-- badges: end -->

The goal of valentine is to spread the love πŸ’› about your
favourite R package via [ChatGPT](https://openai.com/) generated
"roses are red ... " poems 🌹.
favourite R package via "roses are red ... " poems 🌹 generated
by AI via the [ellmer](https://ellmer.tidyverse.org/) πŸ“¦.

## Installation

Expand All @@ -35,17 +35,20 @@ pak::pak("tadascience/valentine")

## Setup

`valentine::roses()` uses the [openai::create_chat_completion()](https://irudnyts.github.io/openai/reference/create_chat_completion.html)
function to create the poem, this needs the `OPENAI_API_KEY` environment
variable set to your openai API key.
`valentine::roses()` uses a [Chat](https://ellmer.tidyverse.org/reference/Chat.html)
object to communicate with the LLM of your choice. The default
value for the `chat` argument uses the "gpt-3.5-turbo" model
from [OpenAI](https://openai.com/) via the
[ellmer::chat_openai()](https://ellmer.tidyverse.org/reference/chat_openai.html)
which is usually good enough for such a simple task.

Once you have retrieved the api key from [openai](https://platform.openai.com/),
the easiest is to store it in your `.Renviron` file via `usethis::edit_r_environ()`.
See the [openai](https://irudnyts.github.io/openai/index.html) πŸ“¦ for more details.
Please refer to [ellmer](https://ellmer.tidyverse.org/index.html) documentation
for information on setting up api keys, etc ...

## Example

```{r example}
valentine::roses("dplyr")
valentine::roses("lubridate", hint = "make it kinky")
valentine::roses("valentine")
```
47 changes: 29 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ status](https://www.r-pkg.org/badges/version/valentine)](https://CRAN.R-project.
<!-- badges: end -->

The goal of valentine is to spread the love πŸ’› about your favourite R
package via [ChatGPT](https://openai.com/) generated β€œroses are red …”
poems 🌹.
package via β€œroses are red …” poems 🌹 generated by AI via the
[ellmer](https://ellmer.tidyverse.org/) πŸ“¦.

## Installation

Expand All @@ -26,28 +26,39 @@ pak::pak("tadascience/valentine")

## Setup

`valentine::roses()` uses the
[openai::create_chat_completion()](https://irudnyts.github.io/openai/reference/create_chat_completion.html)
function to create the poem, this needs the `OPENAI_API_KEY` environment
variable set to your openai API key.
`valentine::roses()` uses a
[Chat](https://ellmer.tidyverse.org/reference/Chat.html) object to
communicate with the LLM of your choice. The default value for the
`chat` argument uses the β€œgpt-3.5-turbo” model from
[OpenAI](https://openai.com/) via the
[ellmer::chat_openai()](https://ellmer.tidyverse.org/reference/chat_openai.html)
which is usually good enough for such a simple task.

Once you have retrieved the api key from
[openai](https://platform.openai.com/), the easiest is to store it in
your `.Renviron` file via `usethis::edit_r_environ()`. See the
[openai](https://irudnyts.github.io/openai/index.html) πŸ“¦ for more
details.
Please refer to [ellmer](https://ellmer.tidyverse.org/index.html)
documentation for information on setting up api keys, etc …

## Example

``` r
valentine::roses("dplyr")
#> Roses are 🌹 red, violets are πŸ’™ blue,
#> With dplyr πŸ“¦, data wrangling is a breeze too.
#> πŸ” Filter, βœ‚οΈ select, and mutate with ease,
#> Data manipulation made simple, no more unease!
#> Roses are red,
#> Dplyr is true,
#> With pipes and verbs,
#> Data wrangling made new! πŸŒΉπŸ’» #rstats
```

``` r
valentine::roses("lubridate", hint = "make it kinky")
#> Roses are red, 🌹
#> Lubridate's sweet, πŸ•°οΈ
#> It handles dates oh so fine, 😍
#> Making time play naughty in our code. 😈
#> Lubridate is sweet, 😏
#> With every date function, my love for it can't be beat, 😍
#> In R programming, it's the perfect treat! πŸ€“ #sorrynotsorry
```

``` r
valentine::roses("valentine")
#> Roses are red 🌹
#> Valentine is neat πŸ“¦
#> Bringing me joy πŸ’–
#> With every code I complete πŸ’»
```

0 comments on commit 7c481b2

Please sign in to comment.