Back to documentation
  • Preparing search index...
  • The search index is not available
API Reference
  • API Reference
  • langgraph-supervisor
  • createSupervisor

Function createSupervisor

  • createSupervisor<AnnotationRootT, StructuredResponseFormat>(__namedParameters): StateGraph<AnnotationRootT["spec"], AnnotationRootT["State"], AnnotationRootT["Update"], string, AnnotationRootT["spec"], AnnotationRootT["spec"], StateDefinition>
  • Create a multi-agent supervisor.

    Type Parameters

    • AnnotationRootT extends AnnotationRoot<any, AnnotationRootT> = AnnotationRoot<{
          messages: BinaryOperatorAggregate<BaseMessage[], Messages>;
      }>
    • StructuredResponseFormat extends Record<string, any> = Record<string, any>

    Parameters

    • __namedParameters: CreateSupervisorParams<AnnotationRootT, StructuredResponseFormat>

    Returns StateGraph<AnnotationRootT["spec"], AnnotationRootT["State"], AnnotationRootT["Update"], string, AnnotationRootT["spec"], AnnotationRootT["spec"], StateDefinition>

    Remarks

    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.

    • Defined in libs/langgraph-supervisor/dist/supervisor.d.ts:65

Settings

Member Visibility

Theme

API Reference
  • Loading...

Generated using TypeDoc