Create a multi-agent supervisor.
createSupervisor<
AnnotationRootT extends AnnotationRoot<any> = any,
StructuredResponseFormat extends Record<string, any> = Record<string, any>
>(
agents: CreateSupervisorParams<AnnotationRootT, StructuredResponseFormat>
): StateGraph<AnnotationRootT["spec"], AnnotationRootT["State"], AnnotationRootT["Update"], string, AnnotationRootT["spec"], AnnotationRootT["spec"]>Important: responseFormat requires the model to support .withStructuredOutput().
Note: The graph will make a separate call to the LLM to generate the structured response after the agent loop is finished. This is not the only strategy to get structured responses, see more options in this guide.
| Name | Type | Description |
|---|---|---|
agents* | CreateSupervisorParams<AnnotationRootT, StructuredResponseFormat> | List of agents to manage |