gptr - Language Model Agents in Live 'R' Sessions
Runs language model agents in an existing 'R' session,
where generated code can inspect and modify objects already in
memory. The peter() function supports interactive chat and
programmatic calls. Conversational models use tools and return
session objects; typed decision models return logical,
character or numeric vectors with associated model
probabilities. Supports the 'Anthropic'
<https://platform.claude.com/docs/en/api/overview>, 'OpenAI'
<https://developers.openai.com/api/reference/overview> and
'Google Gemini' <https://aistudio.google.com/docs> APIs,
'OpenAI'-compatible endpoints, local 'Ollama'
<https://ollama.com> models, and the 'Claude Code' and 'Codex'
command line tools. Decision models include 'Jev', hosted by
'TypeSafe AI' <https://docs.typesafe.ai/introduction>, and the
local 'Clef'. Top-level agent calls and their executed code can
be recorded in 'R' scripts, 'R Markdown' and 'Quarto'
documents, or 'Jupyter' notebooks. Recorded 'R' scripts can be
replayed without model calls when the required inputs and
packages are available.