Pinecone TypeScript SDK - v9.0.0
    Preparing search index...

    Type Alias UploadFileOptions

    UploadFileOptions: {
        metadata?: Record<string, string | number>;
        multimodal?: boolean;
    } & (
        | { file?: never; fileName?: never; path: string }
        | { file: Uploadable; fileName: string; path?: never }
    )

    Options for uploading a file to an assistant.

    Provide either path (a local file path) or file + fileName (an in-memory buffer, blob, or readable stream). The two forms are mutually exclusive.

    Type Declaration

    • Optionalmetadata?: Record<string, string | number>

      Metadata to attach to the file.

    • Optionalmultimodal?: boolean

      Enable image extraction when processing the file.

    • { file?: never; fileName?: never; path: string }
      • Optionalfile?: never

        Unavailable when using the alternative file input.

      • OptionalfileName?: never

        Unavailable when using the alternative file input.

      • path: string

        The local path to the file to upload. The file is read asynchronously. Requires a Node.js runtime; use file on Edge or Workers runtimes.

    • { file: Uploadable; fileName: string; path?: never }
      • file: Uploadable

        The file data to upload. Accepts a Buffer, Blob, or Node.js ReadableStream. Provide fileName for all file inputs.

      • fileName: string

        The filename shown for the uploaded file, such as returns-policy.pdf. Required when using file.

      • Optionalpath?: never

        Unavailable when using the alternative file input.

    import type { UploadFileOptions } from '@pinecone-database/pinecone';
    const options: UploadFileOptions = {
    file: new Blob(['Start a return from your order history.']),
    fileName: 'returns-policy.txt',
    };