Intro Thoughts
Status Quo
library(tidyverse)
Experiment
library(mall)
options(.mall_chat = ellmer::chat_google_gemini())
colors_not_num <- colors()[!(colors() |> str_detect("1|2|3|4|5|6|7|8|9|10"))] |> sample(size = 15)
colors_not_num
## [1] "deeppink" "cyan" "lightyellow" "beige"
## [5] "darkcyan" "darkorange" "darkgoldenrod" "springgreen"
## [9] "grey0" "darkgrey" "greenyellow" "peachpuff"
## [13] "darkgray" "lightgrey" "lavender"
df <- tribble(~item, ~times,
"peacock", 2,
"bear", 3) |>
llm_classify(item,
labels = colors_not_num,
pred_name = ".color")
## Warning: There was 1 warning in `mutate()`.
## ℹ In argument: `.color = llm_vec_classify(x = item, labels = labels,
## additional_prompt = additional_prompt)`.
## Caused by warning:
## ! 1 request errored.
df
## # A tibble: 2 × 3
## item times .color
## <chr> <dbl> <chr>
## 1 peacock 2 <NA>
## 2 bear 3 <NA>
df |>
ggplot() +
aes(x = item) +
geom_bar() +
aes(fill = I(.color))
