Skip to content

Commit

Permalink
update readme to include some info about the api key
Browse files Browse the repository at this point in the history
  • Loading branch information
romainfrancois committed Feb 13, 2024
1 parent 682dc4a commit 85e419a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 13 deletions.
17 changes: 14 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,28 @@ knitr::opts_chunk$set(
[![R-CMD-check](https://github.com/tadascience/valentine/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tadascience/valentine/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

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

## Installation

You can install the development version of valentine like so:
You can install the development version:

``` r
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.

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.

## Example

```{r example}
Expand Down
34 changes: 24 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,42 @@ status](https://www.r-pkg.org/badges/version/valentine)](https://CRAN.R-project.
[![R-CMD-check](https://github.com/tadascience/valentine/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tadascience/valentine/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

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

## Installation

You can install the development version of valentine like so:
You can install the development version:

``` r
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.

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.

## Example

``` r
valentine::roses("dplyr")
#> 🌹 Roses are red, πŸ“¦
#> πŸ’‘ dplyr's the R package that'll make your πŸ’» shine 🌟,
#> πŸ”₯ With its powerful data manipulation capabilities, πŸ“Š
#> 😍 You'll love using it all the time! ❀️
#> 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!
valentine::roses("lubridate", hint = "make it kinky")
#> Roses are red, 🌹
#> lubridate's API, so sexy, πŸ“
#> Dates it manipulates, so flexible, πŸ“…
#> It's time to get kinky, ooh-la-la! 😏
#> Lubridate's sweet, πŸ•°οΈ
#> It handles dates oh so fine, 😍
#> Making time play naughty in our code. 😈
```

0 comments on commit 85e419a

Please sign in to comment.