file_batch_files
Creates, updates, deletes, gets or lists a file_batch_files resource.
Overview
| Name | file_batch_files |
| Type | Resource |
| Id | openai.vector_stores.file_batch_files |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier, which can be referenced in API endpoints. |
vector_store_id | string | The ID of the vector store that the File is attached to. |
attributes | object | Set 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_strategy | object | The strategy used to chunk the file. (title: Static Chunking Strategy) |
created_at | integer (unixtime) | The Unix timestamp (in seconds) for when the vector store file was created. |
last_error | object | The last error associated with this vector store file. Will be null if there are no errors. |
object | string | The object type, which is always vector_store.file. (vector_store.file) |
status | string | The 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_bytes | integer | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | vector_store_id, batch_id | limit, 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.
| Name | Datatype | Description |
|---|---|---|
batch_id | string | The ID of the file batch that the files belong to. |
vector_store_id | string | The ID of the vector store that the files belong to. |
after | string | A 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. |
before | string | A 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. |
filter | string | Filter by file status. One of in_progress, completed, failed, cancelled. |
limit | integer | A 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-organization | string | Optionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as openai_organization. |
openai-project | string | Optionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as openai_project. |
order | string | Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. |
SELECT examples
- list
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 }}'
;