| hal_register_tool | R Documentation |
Shorthand that builds a tool definition and registers it on the active session's chat object.
hal_register_tool(fn, name = NULL, description = NULL, types = NULL)
fn |
The R function to expose as a tool. |
name |
Tool name (defaults to the symbol name of |
description |
Description shown to the LLM (when to call this tool). |
types |
Optional named list mapping argument names to JSON Schema type
strings: |
Invisibly returns the tool definition.
## Not run:
get_time <- function(tz = "UTC") format(Sys.time(), tz = tz)
hal_register_tool(get_time,
description = "Current time in a given timezone"
)
hal("what time is it in Tokyo?")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.