tidyverse / elmer

Call LLM APIs from R
http://elmer.tidyverse.org/
Other
199 stars 28 forks source link

package option for elmer extensions #175

Open simonpcouch opened 13 hours ago

simonpcouch commented 13 hours ago

Been working on a couple BYO-key elmer extensions that aim to support any of the chat_*() backends from elmer, like this one or this one. For each of them, I assume that folks are likely to use the same provider and model most of the time, so I support toggling those arguments using package-level options and recommend setting them in .Rprofile, like:

options(
  .pal_fn = "chat_openai",
  .pal_args = list(model = "gpt-4o-mini")
)

or:

options(
  .ensure_fn = "chat_openai",
  .ensure_args = list(model = "gpt-4o-mini")
)

While I can see the value in having different tools hook into different models by default, I think it'd also be nice to have more general .elmer_fn or .elmer_args options that would apply across extensions. Would yall consider documenting some "recommended" interface for extension options that include more general options like those?