dot-init_helper: Initialize a Helper object

.init_helperR Documentation

Initialize a Helper object

Description

Users typically should not need to call this function.

  • Create new helpers that will automatically be registered with this function with prompt_new().

  • The chores addin will initialize needed helpers on-the-fly.

Usage

.init_helper(chore = NULL, .chores_chat = get_chores_chat())

Arguments

chore

The identifier for a helper prompt. By default one of "cli", "testthat" or "roxygen", though custom helpers can be added with prompt_new().

.chores_chat

An ellmer Chat, e.g. ellmer::chat_claude() or ellmer::chat_google_gemini(). Defaults to the chores.chat option, so e.g. set options(chores.chat = ellmer::chat_claude(model = "claude-haiku-4-5")) in your .Rprofile to configure chores with ellmer every time you start a new R session.

Value

A Helper object, which is a subclass of an ellmer chat.

Examples

# requires an API key and sets options
## Not run: 
# to create a chat with claude:
.init_helper(.chores_chat = ellmer::chat_claude(model = "claude-haiku-4-5"))

# or with OpenAI's GPT-4.1-mini:
.init_helper(.chores_chat = ellmer::chat_openai(model = "gpt-4.1-mini"))

# or with Google's Gemini 3 Flash:
.init_helper(.chores_chat = ellmer::chat_google_gemini(
  model = "gemini-3-flash-preview",
  api_args = list(
    generationConfig = list(
      thinkingConfig = list(thinkingLevel = "minimal")
    )
  )
))

# to set OpenAI's GPT-4.1-mini as the default model powering chores, for example,
# set the following option (possibly in your .Rprofile, if you'd like
# them to persist across sessions):
options(
  chores.chat = ellmer::chat_openai(model = "gpt-4.1-mini")
)

## End(Not run)

chores documentation built on March 5, 2026, 1:07 a.m.