Convert an Agent to a graph node handler function
See also
Other node-helpers:
route_to(),
route_tool_calls(),
tool_node()
Examples
if (FALSE) { # \dontrun{
chat <- ellmer::chat_openai(model = "gpt-4o")
a <- agent("helper", chat)
handler <- as_node(a)
} # }