ADK for TypeScript: API Reference
    Preparing search index...

    Type Alias AgentRouter

    AgentRouter: (
        agents: Readonly<Record<string, BaseAgent>>,
        context: InvocationContext,
        errorContext?: { failedKeys: ReadonlySet<string>; lastError: unknown },
    ) => Promise<string | undefined> | string | undefined

    Type definition for a function that selects an agent based on the invocation context.

    Type Declaration

      • (
            agents: Readonly<Record<string, BaseAgent>>,
            context: InvocationContext,
            errorContext?: { failedKeys: ReadonlySet<string>; lastError: unknown },
        ): Promise<string | undefined> | string | undefined
      • Parameters

        • agents: Readonly<Record<string, BaseAgent>>
        • context: InvocationContext
        • OptionalerrorContext: { failedKeys: ReadonlySet<string>; lastError: unknown }

        Returns Promise<string | undefined> | string | undefined