GenerateResponseData: {
    candidates?: {
        custom?: unknown;
        finishMessage?: string;
        finishReason:
            | "length"
            | "stop"
            | "interrupted"
            | "blocked"
            | "unknown"
            | "other";
        index: number;
        message: {
            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: "user" | "model" | "tool" | "system";
        };
        usage?: {
            custom?: Record<string, number>;
            inputAudioFiles?: number;
            inputCharacters?: number;
            inputImages?: number;
            inputTokens?: number;
            inputVideos?: number;
            outputAudioFiles?: number;
            outputCharacters?: number;
            outputImages?: number;
            outputTokens?: number;
            outputVideos?: number;
            totalTokens?: number;
        };
    }[];
    custom?: unknown;
    finishMessage?: string;
    finishReason?: | "length"
    | "stop"
    | "interrupted"
    | "blocked"
    | "unknown"
    | "other";
    latencyMs?: number;
    message?: {
        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: "user" | "model" | "tool" | "system";
    };
    raw?: unknown;
    request?: {
        candidates?: number;
        config?: any;
        docs?: {
            content: (
                | { media?: undefined; text: string }
                | {
                    media: { contentType?: (...) | (...); 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: "user" | "model" | "tool" | "system";
        }[];
        output?: {
            constrained?: boolean;
            contentType?: string;
            format?: string;
            instructions?: string;
            schema?: Record<string, any>;
        };
        toolChoice?: "required"
        | "auto"
        | "none";
        tools?: {
            description: string;
            inputSchema?: null | Record<string, any>;
            metadata?: Record<string, any>;
            name: string;
            outputSchema?: null | Record<string, any>;
        }[];
    };
    usage?: {
        custom?: Record<string, number>;
        inputAudioFiles?: number;
        inputCharacters?: number;
        inputImages?: number;
        inputTokens?: number;
        inputVideos?: number;
        outputAudioFiles?: number;
        outputCharacters?: number;
        outputImages?: number;
        outputTokens?: number;
        outputVideos?: number;
        totalTokens?: number;
    };
}

Generate response data.

Type declaration

  • Optionalcandidates?: {
        custom?: unknown;
        finishMessage?: string;
        finishReason:
            | "length"
            | "stop"
            | "interrupted"
            | "blocked"
            | "unknown"
            | "other";
        index: number;
        message: {
            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: "user" | "model" | "tool" | "system";
        };
        usage?: {
            custom?: Record<string, number>;
            inputAudioFiles?: number;
            inputCharacters?: number;
            inputImages?: number;
            inputTokens?: number;
            inputVideos?: number;
            outputAudioFiles?: number;
            outputCharacters?: number;
            outputImages?: number;
            outputTokens?: number;
            outputVideos?: number;
            totalTokens?: number;
        };
    }[]
  • Optionalcustom?: unknown
  • OptionalfinishMessage?: string
  • OptionalfinishReason?: "length" | "stop" | "interrupted" | "blocked" | "unknown" | "other"
  • OptionallatencyMs?: number
  • Optionalmessage?: {
        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: "user" | "model" | "tool" | "system";
    }
  • Optionalraw?: unknown
  • Optionalrequest?: {
        candidates?: number;
        config?: any;
        docs?: {
            content: (
                | { media?: undefined; text: string }
                | {
                    media: { contentType?: (...) | (...); 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: "user" | "model" | "tool" | "system";
        }[];
        output?: {
            constrained?: boolean;
            contentType?: string;
            format?: string;
            instructions?: string;
            schema?: Record<string, any>;
        };
        toolChoice?: "required"
        | "auto"
        | "none";
        tools?: {
            description: string;
            inputSchema?: null | Record<string, any>;
            metadata?: Record<string, any>;
            name: string;
            outputSchema?: null | Record<string, any>;
        }[];
    }
  • Optionalusage?: {
        custom?: Record<string, number>;
        inputAudioFiles?: number;
        inputCharacters?: number;
        inputImages?: number;
        inputTokens?: number;
        inputVideos?: number;
        outputAudioFiles?: number;
        outputCharacters?: number;
        outputImages?: number;
        outputTokens?: number;
        outputVideos?: number;
        totalTokens?: number;
    }