# \donttest{
if (interactive()) {
# Create an enhanced multi-agent flow
session <- create_chat_session()
cleaner <- create_agent("Cleaner", "Cleans data")
plotter <- create_agent("Plotter", "Creates plots")
registry <- create_agent_registry(list(cleaner, plotter))
manager <- create_agent("Manager", "Coordinates data analysis")
flow <- create_flow(
session = session,
model = "openai:gpt-4o",
registry = registry,
enable_guardrails = TRUE
)
# Run the manager with auto-delegation (unified delegate_task tool)
result <- flow$run(manager, "Load data and create a visualization")
}
# }
Run the code above in your browser using DataLab