Member Junction
    Preparing search index...

    Type Alias AgentSubAgentRequest<TContext>

    Represents a sub-agent invocation request.

    // Define a typed context
    interface MyContext {
    apiEndpoint: string;
    authToken: string;
    }

    // Use in sub-agent request
    const subAgentRequest: AgentSubAgentRequest<MyContext> = {
    id: 'sub-agent-uuid',
    name: 'DataProcessorAgent',
    message: 'Process the uploaded data',
    terminateAfter: false,
    context: {
    apiEndpoint: 'https://api.example.com',
    authToken: 'bearer-token'
    }
    };
    type AgentSubAgentRequest<TContext = any> = {
        context?: TContext;
        message: string;
        name: string;
        templateParameters?: Record<string, string>;
        terminateAfter: boolean;
    }

    Type Parameters

    • TContext = any

      Type of the context object passed to the sub-agent. This allows for type-safe context propagation from parent to sub-agent. Defaults to any for backward compatibility.

    Index

    Properties

    context?: TContext

    Context data passed to the sub-agent by the parent agent. This context flows through the entire execution hierarchy, allowing sub-agents to access runtime-specific configuration, environment settings, and shared state from their parent agents. Optional because AI determines sub-agent invocation, context comes from execution params.

    message: string

    Context and instructions for the sub-agent

    name: string

    Name of the sub-agent

    templateParameters?: Record<string, string>

    Optional template parameters for sub-agent invocation

    terminateAfter: boolean

    Whether to terminate the parent agent after sub-agent completes