Learn R Programming

aisdk (version 1.1.0)

create_console_agent: 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"
)

Value

An Agent object configured for console interaction.

Arguments

working_dir

Working directory. 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").

Examples

Run this code
# \donttest{
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)
}
# }

Run the code above in your browser using DataLab