| hal_register_tools | R Documentation |
Registers a list of tools on the active hal() session so the model can
call them. Each element may be an ellmer::ToolDef (e.g. from
daisy::daisy_tools()) or a plain hal tool list with name / description
/ fun / parameters. Unlike hal_register_tool(), which builds a tool
from a bare function's formals, this passes each element through the chat's
tool normalizer, so pre-built ToolDefs keep their declared argument schema.
hal_register_tools(tools)
tools |
A list of tool definitions ( |
Invisibly, the number of tools registered.
hal_register_tool(), hal_register_tool_specs()
## Not run:
tools <- list(
hal_tool(function(x, y) x + y, "add",
description = "Add two numbers",
types = list(x = "number", y = "number")
),
hal_tool(function(path) readLines(path), "read_file",
description = "Read a text file"
)
)
hal_register_tools(tools)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.