Skip to contents

Returns a handler function that processes pending tool calls in the state.

Usage

tool_node(tools)

Arguments

tools

Named list of tool functions keyed by tool name.

Value

A function suitable for use as a graph node handler.

Note

These functions are for manual tool dispatch in custom node handlers. When using Agent objects with ellmer, tool calling is handled internally by ellmer's Chat class. See react_graph for the recommended pattern.

See also

Examples

if (FALSE) { # \dontrun{
tools <- list(add = function(a, b) a + b)
handler <- tool_node(tools)
} # }