Creates a list of ellmer tool objects that wrap PRA's exported functions for use with an LLM agent. Each tool includes a description that helps the LLM select the appropriate analysis method and properly format parameters.
Details
Tool wrappers handle serialization between the LLM (JSON strings) and R (lists, matrices, data.frames). Complex inputs like task distribution lists and correlation matrices are accepted as JSON strings and deserialized internally.
Large output vectors (e.g., Monte Carlo simulation samples) are summarized to mean, sd, and key percentiles rather than returning the full vector to the LLM. The full results are stored in the package environment for use by downstream tools (e.g., contingency analysis needs the full distribution).
When used with shinychat, tool results include rich HTML display with inline
plots via ellmer::ContentToolResult.
Examples
if (FALSE) { # \dontrun{
tools <- pra_tools()
chat <- ellmer::chat_ollama(model = "llama3.2")
for (tool in tools) chat$register_tool(tool)
} # }
