ResumeOptions configure how to resume generation after an interrupt.

interface ResumeOptions {
    metadata?: Record<string, any>;
    reply:
        | {
            custom?: Record<string, unknown>;
            data?: unknown;
            media?: undefined;
            metadata?: Record<string, unknown>;
            text?: undefined;
            toolRequest?: undefined;
            toolResponse: { name: string; output?: unknown; ref?: string };
        }
        | {
            custom?: Record<string, unknown>;
            data?: unknown;
            media?: undefined;
            metadata?: Record<string, unknown>;
            text?: undefined;
            toolRequest?: undefined;
            toolResponse: { name: string; output?: unknown; ref?: string };
        }[];
}

Properties

Properties

metadata?: Record<string, any>

Additional metadata to annotate the created tool message with in the "resume" key.

reply:
    | {
        custom?: Record<string, unknown>;
        data?: unknown;
        media?: undefined;
        metadata?: Record<string, unknown>;
        text?: undefined;
        toolRequest?: undefined;
        toolResponse: { name: string; output?: unknown; ref?: string };
    }
    | {
        custom?: Record<string, unknown>;
        data?: unknown;
        media?: undefined;
        metadata?: Record<string, unknown>;
        text?: undefined;
        toolRequest?: undefined;
        toolResponse: { name: string; output?: unknown; ref?: string };
    }[]

reply should contain a single or list of toolResponse parts corresponding to interrupt toolRequest parts from the most recent model message. Each entry must have a matching name and ref (if supplied) for its toolRequest counterpart.

Tools have a .reply helper method to construct a reply ToolResponse and validate the data against its schema. Call myTool.reply(interruptToolRequest, yourReplyData).