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

Function addActiveAgentRouter

  • addActiveAgentRouter<AnnotationRootT>(builder, __namedParameters): StateGraph<AnnotationRootT["spec"], AnnotationRootT["State"], AnnotationRootT["Update"], any, AnnotationRootT["spec"], AnnotationRootT["spec"], StateDefinition>
  • Add a router to the currently active agent to the StateGraph.

    Type Parameters

    • AnnotationRootT extends AnnotationRoot<any, AnnotationRootT> = AnnotationRoot<{
          activeAgent: {
              Root: (<S>(sd) => AnnotationRoot<S>);
              (): LastValue<string>;
              (annotation): BinaryOperatorAggregate<string, string>;
          };
          messages: BinaryOperatorAggregate<BaseMessage[], Messages>;
      }>

    Parameters

    • builder: StateGraph<AnnotationRootT["spec"], AnnotationRootT["State"], AnnotationRootT["Update"], any, AnnotationRootT["spec"], AnnotationRootT["spec"], StateDefinition>

      The graph builder (StateGraph) to add the router to.

    • __namedParameters: {
          defaultActiveAgent: string;
          routeTo: string[];
      }
      • defaultActiveAgent: string
      • routeTo: string[]

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

    StateGraph with the router added.

    • Defined in libs/langgraph-swarm/dist/swarm.d.ts:21

Settings

Member Visibility

Theme

API Reference
  • Loading...

Generated using TypeDoc