View source: R/console_agent.R
| create_console_agent | R Documentation |
Create the default intelligent terminal agent for console_chat(). This agent can execute commands, manage files, and run R code through natural language interaction.
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"
)
working_dir |
Working directory for sandboxed tool execution. Defaults to |
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 |
skills |
Optional skill paths, |
profile |
Console profile. |
extensions |
Extension loading mode. Defaults to |
An Agent object configured for console interaction.
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.