Skip to contents

bebel_r_agent() is a higher-level layer inspired by R console agent harnesses. It keeps one BebeLM agent, a private tool context, and a small R tool catalog together so the same object can be driven by a console loop or by the JSON-RPC server.

Usage

bebel_r_agent(
  model,
  system_prompt = NULL,
  tools = NULL,
  env = .GlobalEnv,
  cwd = getwd(),
  allow_eval = FALSE,
  prompt_style = c("compact", "full"),
  greedy = FALSE,
  max_gen = 512,
  max_context = 4096,
  max_think = 64,
  temperature = 0.8,
  top_k = 50,
  repeat_penalty = 1.1
)

Arguments

model

A BebelModel object.

system_prompt

System prompt. NULL builds a default prompt including the tool catalog.

tools

Tool catalog. Defaults to bebel_default_r_tools().

env

Environment exposed to R tools.

cwd

Working directory for file tools.

allow_eval

Whether to include an r_eval tool that executes code.

prompt_style

Tool prompt verbosity. "compact" is faster for console use; "full" includes descriptions for every argument.

greedy, max_gen, max_context, max_think, temperature, top_k, repeat_penalty

Generation options passed to bebel_agent().

Value

A bebelRAgent environment.