Create a rtemis.llm Agent
create_agent.RdCreate 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
)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_nameis 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/audit log. If NULL, the package default (
"rtemis.llm_security_log.jsonl"relative togetwd()) is used. Can be overridden per call via thelogfileargument to generate.- verbosity
Integer: Verbosity level.
Examples
# Requires Ollama server running and gemma4:e4b model available
if (FALSE) { # \dontrun{
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
)
} # }