Sanity Library Reference Docs
    Preparing search index...

    Interface operations

    interface operations {
        chat: {
            parameters: {
                cookie?: undefined;
                header?: undefined;
                path: { organizationId: string; threadId: string };
                query?: undefined;
            };
            requestBody: {
                content: {
                    "application/json": {
                        application?: {
                            bundleVersion?: string;
                            intentBaseUrl?: string;
                            key?: string;
                            name?: string;
                            resource?: { id?: string; type?: "dataset" };
                            schemaDescriptorId?: string;
                            title?: string;
                        };
                        config?: {
                            capabilities?: {
                                features?: { webSearch?: (...)
                                | (...)
                                | (...) };
                                read?: boolean | { preset: (...) | (...) };
                                write?: boolean | { preset: (...) | (...) };
                            };
                            filter?: { read?: string; write?: string };
                            instruction?: string;
                            perspectives?: { read?: string[]; write?: string };
                            userMessageContext?: { [key: string]: string };
                        };
                        format: "markdown"
                        | "directives";
                        messages: {
                            content: string;
                            id?: string;
                            name?: string;
                            role: "user" | "assistant" | "system";
                        }[];
                        stream: boolean;
                    };
                };
            };
            responses: {
                "200": {
                    content: {
                        "application/json": { applicationKey?: string; text?: string };
                        "text/event-stream": string;
                    };
                    headers: {
                        "Content-Type"?: string;
                        "X-Vercel-AI-Data-Stream"?: string;
                        [name: string]: unknown;
                    };
                };
                "400": {
                    content: {
                        "application/json": {
                            details?: string;
                            error: string;
                            issues?: { code?: string; message?: string; path?: string[] }[];
                        };
                    };
                    headers: { [name: string]: unknown };
                };
                "401": {
                    content: {
                        "application/json": {
                            details?: string;
                            error: string;
                            issues?: { code?: string; message?: string; path?: string[] }[];
                        };
                    };
                    headers: { [name: string]: unknown };
                };
                "500": {
                    content: {
                        "application/json": {
                            details?: string;
                            error: string;
                            issues?: { code?: string; message?: string; path?: string[] }[];
                        };
                    };
                    headers: { [name: string]: unknown };
                };
            };
        };
        prompt: {
            parameters: {
                cookie?: undefined;
                header?: undefined;
                path?: undefined;
                query?: undefined;
            };
            requestBody: {
                content: {
                    "application/json": {
                        config?: {
                            capabilities?: {
                                features?: { webSearch?: (...)
                                | (...)
                                | (...) };
                                read?: boolean | { preset: (...) | (...) };
                                write?: boolean | { preset: (...) | (...) };
                            };
                            filter?: { read?: string; write?: string };
                            instruction?: string;
                            perspectives?: { read?: string[]; write?: string };
                            userMessageContext?: { [key: string]: string };
                        };
                        format: "markdown"
                        | "directives";
                        instructions?: string;
                        message: string;
                        organizationId: string;
                    };
                };
            };
            responses: {
                "200": {
                    content: { "text/event-stream": string };
                    headers: {
                        "Content-Type"?: string;
                        "X-Vercel-AI-Data-Stream"?: string;
                        [name: string]: unknown;
                    };
                };
                "400": {
                    content: {
                        "application/json": {
                            details?: string;
                            error: string;
                            issues?: { code?: string; message?: string; path?: string[] }[];
                        };
                    };
                    headers: { [name: string]: unknown };
                };
                "401": {
                    content: {
                        "application/json": {
                            details?: string;
                            error: string;
                            issues?: { code?: string; message?: string; path?: string[] }[];
                        };
                    };
                    headers: { [name: string]: unknown };
                };
                "500": {
                    content: {
                        "application/json": {
                            details?: string;
                            error: string;
                            issues?: { code?: string; message?: string; path?: string[] }[];
                        };
                    };
                    headers: { [name: string]: unknown };
                };
            };
        };
    }
    Index

    Properties

    Properties

    chat: {
        parameters: {
            cookie?: undefined;
            header?: undefined;
            path: { organizationId: string; threadId: string };
            query?: undefined;
        };
        requestBody: {
            content: {
                "application/json": {
                    application?: {
                        bundleVersion?: string;
                        intentBaseUrl?: string;
                        key?: string;
                        name?: string;
                        resource?: { id?: string; type?: "dataset" };
                        schemaDescriptorId?: string;
                        title?: string;
                    };
                    config?: {
                        capabilities?: {
                            features?: { webSearch?: (...)
                            | (...)
                            | (...) };
                            read?: boolean | { preset: (...) | (...) };
                            write?: boolean | { preset: (...) | (...) };
                        };
                        filter?: { read?: string; write?: string };
                        instruction?: string;
                        perspectives?: { read?: string[]; write?: string };
                        userMessageContext?: { [key: string]: string };
                    };
                    format: "markdown"
                    | "directives";
                    messages: {
                        content: string;
                        id?: string;
                        name?: string;
                        role: "user" | "assistant" | "system";
                    }[];
                    stream: boolean;
                };
            };
        };
        responses: {
            "200": {
                content: {
                    "application/json": { applicationKey?: string; text?: string };
                    "text/event-stream": string;
                };
                headers: {
                    "Content-Type"?: string;
                    "X-Vercel-AI-Data-Stream"?: string;
                    [name: string]: unknown;
                };
            };
            "400": {
                content: {
                    "application/json": {
                        details?: string;
                        error: string;
                        issues?: { code?: string; message?: string; path?: string[] }[];
                    };
                };
                headers: { [name: string]: unknown };
            };
            "401": {
                content: {
                    "application/json": {
                        details?: string;
                        error: string;
                        issues?: { code?: string; message?: string; path?: string[] }[];
                    };
                };
                headers: { [name: string]: unknown };
            };
            "500": {
                content: {
                    "application/json": {
                        details?: string;
                        error: string;
                        issues?: { code?: string; message?: string; path?: string[] }[];
                    };
                };
                headers: { [name: string]: unknown };
            };
        };
    }
    prompt: {
        parameters: {
            cookie?: undefined;
            header?: undefined;
            path?: undefined;
            query?: undefined;
        };
        requestBody: {
            content: {
                "application/json": {
                    config?: {
                        capabilities?: {
                            features?: { webSearch?: (...)
                            | (...)
                            | (...) };
                            read?: boolean | { preset: (...) | (...) };
                            write?: boolean | { preset: (...) | (...) };
                        };
                        filter?: { read?: string; write?: string };
                        instruction?: string;
                        perspectives?: { read?: string[]; write?: string };
                        userMessageContext?: { [key: string]: string };
                    };
                    format: "markdown"
                    | "directives";
                    instructions?: string;
                    message: string;
                    organizationId: string;
                };
            };
        };
        responses: {
            "200": {
                content: { "text/event-stream": string };
                headers: {
                    "Content-Type"?: string;
                    "X-Vercel-AI-Data-Stream"?: string;
                    [name: string]: unknown;
                };
            };
            "400": {
                content: {
                    "application/json": {
                        details?: string;
                        error: string;
                        issues?: { code?: string; message?: string; path?: string[] }[];
                    };
                };
                headers: { [name: string]: unknown };
            };
            "401": {
                content: {
                    "application/json": {
                        details?: string;
                        error: string;
                        issues?: { code?: string; message?: string; path?: string[] }[];
                    };
                };
                headers: { [name: string]: unknown };
            };
            "500": {
                content: {
                    "application/json": {
                        details?: string;
                        error: string;
                        issues?: { code?: string; message?: string; path?: string[] }[];
                    };
                };
                headers: { [name: string]: unknown };
            };
        };
    }