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

    Type Alias UpsertFileOptions

    UpsertFileOptions: { assistantFileId: string; multimodal?: boolean } & (
        | { file?: never; fileName?: never; path: string }
        | { file: Uploadable; fileName: string; path?: never }
    )

    Options for creating or replacing a file on an assistant at a caller-supplied file ID.

    Provide the assistantFileId to create or replace, along with either path (a local file path) or file + fileName (an in-memory buffer, blob, or readable stream). The two content forms are mutually exclusive.

    Unlike UploadFileOptions — which always creates a new file with a server-generated ID — upsert is keyed on the ID you supply and does not accept metadata.

    Type Declaration

    • assistantFileId: string

      The ID of the file to create or replace. If a file with this ID already exists, its content is replaced; otherwise a new file is created with this identifier.

    • 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 { UpsertFileOptions } from '@pinecone-database/pinecone';
    const options: UpsertFileOptions = {
    assistantFileId: '1a56ddd0-c6d8-4295-80c0-9bfd6f5cb87b',
    path: 'returns-policy.pdf',
    };