Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/openai/resources/beta/vector-stores/file-batches.ts>FileBatches

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
namespace FileBatches
import { FileBatches } from "https://deno.land/x/openai@v4.62.1/resources/beta/vector-stores/file-batches.ts";
class FileBatches
extends APIResource
import { FileBatches } from "https://deno.land/x/openai@v4.62.1/resources/beta/vector-stores/file-batches.ts";

Methods

cancel(
vectorStoreId: string,
batchId: string,
options?: Core.RequestOptions,
): Core.APIPromise<VectorStoreFileBatch>

Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.

create(
vectorStoreId: string,
options?: Core.RequestOptions,
): Core.APIPromise<VectorStoreFileBatch>

Create a vector store file batch.

createAndPoll(
vectorStoreId: string,
options?: Core.RequestOptions & { pollIntervalMs?: number; },
): Promise<VectorStoreFileBatch>

Create a vector store batch and poll until all files have been processed.

listFiles(
vectorStoreId: string,
batchId: string,
options?: Core.RequestOptions,
): Core.PagePromise<VectorStoreFilesPage, FilesAPI.VectorStoreFile>

Returns a list of vector store files in a batch.

listFiles(
vectorStoreId: string,
batchId: string,
options?: Core.RequestOptions,
): Core.PagePromise<VectorStoreFilesPage, FilesAPI.VectorStoreFile>
poll(
vectorStoreId: string,
batchId: string,
options?: Core.RequestOptions & { pollIntervalMs?: number; },
): Promise<VectorStoreFileBatch>

Wait for the given file batch to be processed.

Note: this will return even if one of the files failed to process, you need to check batch.file_counts.failed_count to handle this case.

retrieve(
vectorStoreId: string,
batchId: string,
options?: Core.RequestOptions,
): Core.APIPromise<VectorStoreFileBatch>

Retrieves a vector store file batch.

uploadAndPoll(
vectorStoreId: string,
unnamed 1: { files: Uploadable[]; fileIds?: string[]; },
options?: Core.RequestOptions & { pollIntervalMs?: number; maxConcurrency?: number; },
): Promise<VectorStoreFileBatch>

Uploads the given files concurrently and then creates a vector store file batch.

The concurrency limit is configurable using the maxConcurrency parameter.