Learn R Programming

rtemis.llm (version 0.8.1)

create_agent: Create a rtemis.llm Agent

Description

Create a rtemis.llm Agent

Usage

create_agent(
  llmconfig,
  system_prompt = SYSTEM_PROMPT_DEFAULT,
  use_memory = TRUE,
  tools = NULL,
  max_tool_rounds = 3L,
  output_schema = NULL,
  name = NULL,
  allow_custom_tools = FALSE,
  logfile = NULL,
  verbosity = 1L
)

Value

Agent object

Arguments

llmconfig

LLMConfig: The LLM configuration to use. Create using one of config_Ollama, config_OpenAI, or config_Anthropic.

system_prompt

Optional character: The system prompt to use.

use_memory

Logical: Whether to use conversation memory.

tools

Optional list of Tool objects: The tools available to the agent.

max_tool_rounds

Integer: Maximum number of tool call rounds per query.

output_schema

Optional Schema: The output schema to enforce on the agent's response created using schema and field.

name

Optional character: The name of the agent.

allow_custom_tools

Logical: If TRUE, allow the agent to carry tools whose function_name is not in the package allowlist. Such tools must be built via create_custom_tool and supply their own function body. The caller vouches for that code: built-in package guarantees (allowlist + hash verification) do not apply to it. Defaults to FALSE.

logfile

Optional character: Path to the agent's security log. Important! If NULL, the value will be set to getOption("rtemis_security_logfile", tempfile("rtemis_security_log_", fileext = ".jsonl")) to satisfy CRAN policy. It is important to set it to a non-temporary location that will persist and you can access. Otherwise, security incidents may be missed. Can be overridden per call on generate.

verbosity

Integer: Verbosity level.

Author

EDG

Examples

Run this code
# Requires Ollama server running and gemma4:e4b model available
if (FALSE) {
  agent <- create_agent(
    config_Ollama(
      model_name = "gemma4:e4b",
      temperature = 0.2
    ),
    system_prompt = "You are professor of Trance at the Institute of Advanced Beat Studies.",
    use_memory = TRUE
  )
}

Run the code above in your browser using DataLab