View source: R/agent_library.R
| create_coder_agent | R Documentation |
Creates an agent specialized in writing and executing R code. The agent can execute R code in the session environment, making results available to other agents. Enhanced version with better safety controls and debugging support.
create_coder_agent(
name = "CoderAgent",
safe_mode = TRUE,
timeout_ms = 30000,
max_output_lines = 200
)
name |
Agent name. Default "CoderAgent". |
safe_mode |
If TRUE (default), restricts file system and network access. |
timeout_ms |
Code execution timeout in milliseconds. Default 30000. |
max_output_lines |
Maximum output lines to return. Default 50. |
An Agent object configured for R code execution.
if (interactive()) {
coder <- create_coder_agent()
session <- create_shared_session(model = "openai:gpt-4o")
result <- coder$run(
"Create a data frame with 3 rows and calculate the mean",
session = session,
model = "openai:gpt-4o"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.