Builds a single-agent graph with state management and checkpointing.
Tool calling is handled internally by ellmer's Chat class during
$chat(), so no separate tool dispatch node is needed.
Details
Tools should be registered on the agent at construction time via
agent(tools = ...) rather than passed here.
See also
Other agents:
agent()
Other convenience:
pipeline_graph(),
supervisor_graph()
Examples
if (FALSE) { # \dontrun{
chat <- ellmer::chat_openai(model = "gpt-4o")
a <- agent("assistant", chat)
graph <- react_graph(a)
graph$invoke(list(messages = list("Hello")))
} # }