Hierarchy

  • APIResource
    • Files

Constructors

Methods

  • Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the delete file endpoint.

    Parameters

    • vectorStoreId: string
    • fileId: string
    • Optionaloptions: RequestOptions<unknown>

    Returns APIPromise<VectorStoreFileDeleted>

  • Wait for the vector store file to finish processing.

    Note: this will return even if the file failed to process, you need to check file.last_error and file.status to handle these cases

    Parameters

    • vectorStoreId: string
    • fileId: string
    • Optionaloptions: RequestOptions<unknown> & {
          pollIntervalMs?: number;
      }

    Returns Promise<VectorStoreFile>

  • Retrieves a vector store file.

    Parameters

    • vectorStoreId: string
    • fileId: string
    • Optionaloptions: RequestOptions<unknown>

    Returns APIPromise<VectorStoreFile>

  • Upload a file to the files API and then attach it to the given vector store.

    Note the file will be asynchronously processed (you can use the alternative polling helper method to wait for processing to complete).

    Parameters

    • vectorStoreId: string
    • file: Uploadable
    • Optionaloptions: RequestOptions<unknown>

    Returns Promise<VectorStoreFile>

  • Add a file to a vector store and poll until processing is complete.

    Parameters

    • vectorStoreId: string
    • file: Uploadable
    • Optionaloptions: RequestOptions<unknown> & {
          pollIntervalMs?: number;
      }

    Returns Promise<VectorStoreFile>