Interface GenerateRequest<CustomOptionsSchema>

Generate request.

interface GenerateRequest<CustomOptionsSchema extends ZodTypeAny = ZodTypeAny> {
    candidates?: number;
    config?: TypeOf<CustomOptionsSchema>;
    docs?: {
        content: (
            | { media?: undefined; text: string }
            | { media: { contentType?: string; url: string }; text?: undefined }
        )[];
        metadata?: Record<string, any>;
    }[];
    messages: {
        content: (
            | {
                custom?: Record<string, unknown>;
                data?: unknown;
                media?: undefined;
                metadata?: Record<string, unknown>;
                text: string;
                toolRequest?: undefined;
                toolResponse?: undefined;
            }
            | {
                custom?: Record<string, unknown>;
                data?: unknown;
                media: { contentType?: string; url: string };
                metadata?: Record<string, unknown>;
                text?: undefined;
                toolRequest?: undefined;
                toolResponse?: undefined;
            }
            | {
                custom?: Record<string, unknown>;
                data?: unknown;
                media?: undefined;
                metadata?: Record<string, unknown>;
                text?: undefined;
                toolRequest: { input?: unknown; name: string; ref?: string };
                toolResponse?: undefined;
            }
            | {
                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?: undefined;
            }
            | {
                custom: Record<string, any>;
                data?: unknown;
                media?: undefined;
                metadata?: Record<string, unknown>;
                text?: undefined;
                toolRequest?: undefined;
                toolResponse?: undefined;
            }
        )[];
        metadata?: Record<string, unknown>;
        role: "model" | "tool" | "system" | "user";
    }[];
    output?: {
        constrained?: boolean;
        contentType?: string;
        format?: string;
        instructions?: string;
        schema?: Record<string, any>;
    };
    tools?: {
        description: string;
        inputSchema?: null
        | Record<string, any>;
        metadata?: Record<string, any>;
        name: string;
        outputSchema?: null | Record<string, any>;
    }[];
}

Type Parameters

Hierarchy (View Summary)

Properties

candidates?: number
docs?: {
    content: (
        | { media?: undefined; text: string }
        | { media: { contentType?: string; url: string }; text?: undefined }
    )[];
    metadata?: Record<string, any>;
}[]
messages: {
    content: (
        | {
            custom?: Record<string, unknown>;
            data?: unknown;
            media?: undefined;
            metadata?: Record<string, unknown>;
            text: string;
            toolRequest?: undefined;
            toolResponse?: undefined;
        }
        | {
            custom?: Record<string, unknown>;
            data?: unknown;
            media: { contentType?: string; url: string };
            metadata?: Record<string, unknown>;
            text?: undefined;
            toolRequest?: undefined;
            toolResponse?: undefined;
        }
        | {
            custom?: Record<string, unknown>;
            data?: unknown;
            media?: undefined;
            metadata?: Record<string, unknown>;
            text?: undefined;
            toolRequest: { input?: unknown; name: string; ref?: string };
            toolResponse?: undefined;
        }
        | {
            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?: undefined;
        }
        | {
            custom: Record<string, any>;
            data?: unknown;
            media?: undefined;
            metadata?: Record<string, unknown>;
            text?: undefined;
            toolRequest?: undefined;
            toolResponse?: undefined;
        }
    )[];
    metadata?: Record<string, unknown>;
    role: "model" | "tool" | "system" | "user";
}[]
output?: {
    constrained?: boolean;
    contentType?: string;
    format?: string;
    instructions?: string;
    schema?: Record<string, any>;
}
tools?: {
    description: string;
    inputSchema?: null | Record<string, any>;
    metadata?: Record<string, any>;
    name: string;
    outputSchema?: null | Record<string, any>;
}[]