Skip to main content

file_batch_files

Creates, updates, deletes, gets or lists a file_batch_files resource.

Overview

Namefile_batch_files
TypeResource
Idopenai.vector_stores.file_batch_files

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe identifier, which can be referenced in API endpoints.
vector_store_idstringThe ID of the vector store that the File is attached to.
attributesobjectSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers. (x-oaiTypeLabel: map)
chunking_strategyobjectThe strategy used to chunk the file. (title: Static Chunking Strategy)
created_atinteger (unixtime)The Unix timestamp (in seconds) for when the vector store file was created.
last_errorobjectThe last error associated with this vector store file. Will be null if there are no errors.
objectstringThe object type, which is always vector_store.file. (vector_store.file)
statusstringThe status of the vector store file, which can be either in_progress, completed, cancelled, or failed. The status completed indicates that the vector store file is ready for use. (in_progress, completed, cancelled, failed)
usage_bytesintegerThe total vector store usage in bytes. Note that this may be different from the original file size.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectvector_store_id, batch_idlimit, order, after, before, filter, openai-organization, openai-project

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
batch_idstringThe ID of the file batch that the files belong to.
vector_store_idstringThe ID of the vector store that the files belong to.
afterstringA cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforestringA cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
filterstringFilter by file status. One of in_progress, completed, failed, cancelled.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Automatically applied from a SQL LIMIT clause - SELECT ... LIMIT 10 sends limit=10 on the wire. Setting it explicitly in a WHERE clause is not required.
openai-organizationstringOptionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as openai_organization.
openai-projectstringOptionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as openai_project.
orderstringSort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

SELECT examples

OK

SELECT
id,
vector_store_id,
attributes,
chunking_strategy,
created_at,
last_error,
object,
status,
usage_bytes
FROM openai.vector_stores.file_batch_files
WHERE vector_store_id = '{{ vector_store_id }}' -- required
AND batch_id = '{{ batch_id }}' -- required
AND "order" = '{{ order }}'
AND after = '{{ after }}'
AND before = '{{ before }}'
AND filter = '{{ filter }}'
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;