create_console_agent: Create Console Agent

View source: R/console_agent.R

create_console_agentR Documentation

Create Console Agent

Description

Create the default intelligent terminal agent for console_chat(). This agent can execute commands, manage files, and run R code through natural language interaction.

Usage

create_console_agent(
  working_dir = tempdir(),
  sandbox_mode = "permissive",
  additional_tools = NULL,
  language = "auto",
  startup_dir = working_dir,
  skills = "auto",
  profile = c("minimal", "legacy"),
  extensions = "auto"
)

Arguments

working_dir

Working directory for sandboxed tool execution. Defaults to tempdir().

sandbox_mode

Sandbox mode: "strict", "permissive", or "none" (default: "permissive").

additional_tools

Optional list of additional Tool objects to include.

language

Language for responses: "auto", "en", or "zh" (default: "auto").

startup_dir

R session startup directory used for project-aware context. Defaults to getwd().

skills

Optional skill paths, "auto", or a SkillRegistry object.

profile

Console profile. "minimal" is the default Pi-like tool set; "legacy" restores the previous all-in-one console agent.

extensions

Extension loading mode. Defaults to "auto".

Value

An Agent object configured for console interaction.

Examples


if (interactive()) {
    # Create default console agent
    agent <- create_console_agent()

    # Create with custom working directory
    agent <- create_console_agent(working_dir = "~/projects/myapp")

    # Use with console_chat
    console_chat("openai:gpt-4o", agent = agent)
}


aisdk documentation built on May 29, 2026, 9:07 a.m.