if (FALSE) {
supervisor_fn <- function(state) {
if (is.null(state$turn) || state$turn == 0) "Researcher" else "FINISH"
}
workers <- list(
Researcher = function(state) {
list(result = "Research complete")
},
Writer = function(state) {
list(result = "Draft complete")
}
)
team <- build_custom_multi_agent(
supervisor = supervisor_fn,
workers = workers,
output = "both"
)
cat(team$mermaid)
team$run(list())
}
Run the code above in your browser using DataLab