feat(api): Add Vector Store File batches api stub (#3615)
Some checks failed
SqlStore Integration Tests / test-postgres (3.12) (push) Failing after 0s
SqlStore Integration Tests / test-postgres (3.13) (push) Failing after 0s
Integration Auth Tests / test-matrix (oauth2_token) (push) Failing after 1s
Python Package Build Test / build (3.12) (push) Failing after 1s
Test External Providers Installed via Module / test-external-providers-from-module (venv) (push) Has been skipped
Integration Tests (Replay) / Integration Tests (, , , client=, ) (push) Failing after 3s
API Conformance Tests / check-schema-compatibility (push) Successful in 7s
Python Package Build Test / build (3.13) (push) Failing after 2s
Vector IO Integration Tests / test-matrix (push) Failing after 4s
Test External API and Providers / test-external (venv) (push) Failing after 4s
Unit Tests / unit-tests (3.12) (push) Failing after 4s
Unit Tests / unit-tests (3.13) (push) Failing after 4s
UI Tests / ui-tests (22) (push) Successful in 34s
Pre-commit / pre-commit (push) Successful in 1m14s

# What does this PR do?
Adding api stubs for vector store file batches apis
https://github.com/llamastack/llama-stack/issues/3533
API Ref:
https://platform.openai.com/docs/api-reference/vector-stores-file-batches

## Test Plan
CI
This commit is contained in:
slekkala1 2025-09-30 12:07:33 -07:00 committed by GitHub
parent 1e25a72ece
commit cc64093ae4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 1038 additions and 85 deletions

View file

@ -3369,6 +3369,44 @@ paths:
schema:
$ref: '#/components/schemas/OpenaiAttachFileToVectorStoreRequest'
required: true
/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel:
post:
responses:
'200':
description: >-
A VectorStoreFileBatchObject representing the cancelled file batch.
content:
application/json:
schema:
$ref: '#/components/schemas/VectorStoreFileBatchObject'
'400':
$ref: '#/components/responses/BadRequest400'
'429':
$ref: >-
#/components/responses/TooManyRequests429
'500':
$ref: >-
#/components/responses/InternalServerError500
default:
$ref: '#/components/responses/DefaultError'
tags:
- VectorIO
summary: Cancels a vector store file batch.
description: Cancels a vector store file batch.
parameters:
- name: batch_id
in: path
description: The ID of the file batch to cancel.
required: true
schema:
type: string
- name: vector_store_id
in: path
description: >-
The ID of the vector store containing the file batch.
required: true
schema:
type: string
/v1/completions:
post:
responses:
@ -3490,6 +3528,44 @@ paths:
schema:
$ref: '#/components/schemas/OpenaiCreateVectorStoreRequest'
required: true
/v1/vector_stores/{vector_store_id}/file_batches:
post:
responses:
'200':
description: >-
A VectorStoreFileBatchObject representing the created file batch.
content:
application/json:
schema:
$ref: '#/components/schemas/VectorStoreFileBatchObject'
'400':
$ref: '#/components/responses/BadRequest400'
'429':
$ref: >-
#/components/responses/TooManyRequests429
'500':
$ref: >-
#/components/responses/InternalServerError500
default:
$ref: '#/components/responses/DefaultError'
tags:
- VectorIO
summary: Create a vector store file batch.
description: Create a vector store file batch.
parameters:
- name: vector_store_id
in: path
description: >-
The ID of the vector store to create the file batch for.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OpenaiCreateVectorStoreFileBatchRequest'
required: true
/v1/files/{file_id}:
get:
responses:
@ -3916,6 +3992,87 @@ paths:
- file
- purpose
required: true
/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files:
get:
responses:
'200':
description: >-
A VectorStoreFilesListInBatchResponse containing the list of files in
the batch.
content:
application/json:
schema:
$ref: '#/components/schemas/VectorStoreFilesListInBatchResponse'
'400':
$ref: '#/components/responses/BadRequest400'
'429':
$ref: >-
#/components/responses/TooManyRequests429
'500':
$ref: >-
#/components/responses/InternalServerError500
default:
$ref: '#/components/responses/DefaultError'
tags:
- VectorIO
summary: >-
Returns a list of vector store files in a batch.
description: >-
Returns a list of vector store files in a batch.
parameters:
- name: batch_id
in: path
description: >-
The ID of the file batch to list files from.
required: true
schema:
type: string
- name: vector_store_id
in: path
description: >-
The ID of the vector store containing the file batch.
required: true
schema:
type: string
- name: after
in: query
description: >-
A cursor for use in pagination. `after` is an object ID that defines your
place in the list.
required: false
schema:
type: string
- name: before
in: query
description: >-
A cursor for use in pagination. `before` is an object ID that defines
your place in the list.
required: false
schema:
type: string
- name: filter
in: query
description: >-
Filter by file status. One of in_progress, completed, failed, cancelled.
required: false
schema:
type: string
- name: limit
in: query
description: >-
A limit on the number of objects to be returned. Limit can range between
1 and 100, and the default is 20.
required: false
schema:
type: integer
- name: order
in: query
description: >-
Sort order by the `created_at` timestamp of the objects. `asc` for ascending
order and `desc` for descending order.
required: false
schema:
type: string
/v1/files/{file_id}/content:
get:
responses:
@ -3950,6 +4107,44 @@ paths:
required: true
schema:
type: string
/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}:
get:
responses:
'200':
description: >-
A VectorStoreFileBatchObject representing the file batch.
content:
application/json:
schema:
$ref: '#/components/schemas/VectorStoreFileBatchObject'
'400':
$ref: '#/components/responses/BadRequest400'
'429':
$ref: >-
#/components/responses/TooManyRequests429
'500':
$ref: >-
#/components/responses/InternalServerError500
default:
$ref: '#/components/responses/DefaultError'
tags:
- VectorIO
summary: Retrieve a vector store file batch.
description: Retrieve a vector store file batch.
parameters:
- name: batch_id
in: path
description: The ID of the file batch to retrieve.
required: true
schema:
type: string
- name: vector_store_id
in: path
description: >-
The ID of the vector store containing the file batch.
required: true
schema:
type: string
/v1/vector_stores/{vector_store_id}/files/{file_id}/content:
get:
responses:
@ -10870,6 +11065,75 @@ components:
const: cancelled
- type: string
const: failed
VectorStoreFileBatchObject:
type: object
properties:
id:
type: string
description: Unique identifier for the file batch
object:
type: string
default: vector_store.file_batch
description: >-
Object type identifier, always "vector_store.file_batch"
created_at:
type: integer
description: >-
Timestamp when the file batch was created
vector_store_id:
type: string
description: >-
ID of the vector store containing the file batch
status:
$ref: '#/components/schemas/VectorStoreFileStatus'
description: >-
Current processing status of the file batch
file_counts:
$ref: '#/components/schemas/VectorStoreFileCounts'
description: >-
File processing status counts for the batch
additionalProperties: false
required:
- id
- object
- created_at
- vector_store_id
- status
- file_counts
title: VectorStoreFileBatchObject
description: OpenAI Vector Store File Batch object.
VectorStoreFileCounts:
type: object
properties:
completed:
type: integer
description: >-
Number of files that have been successfully processed
cancelled:
type: integer
description: >-
Number of files that had their processing cancelled
failed:
type: integer
description: Number of files that failed to process
in_progress:
type: integer
description: >-
Number of files currently being processed
total:
type: integer
description: >-
Total number of files in the vector store
additionalProperties: false
required:
- completed
- cancelled
- failed
- in_progress
- total
title: VectorStoreFileCounts
description: >-
File processing status counts for a vector store.
OpenAIJSONSchema:
type: object
properties:
@ -11432,38 +11696,6 @@ components:
The ID of the provider to use for this vector store.
additionalProperties: false
title: OpenaiCreateVectorStoreRequest
VectorStoreFileCounts:
type: object
properties:
completed:
type: integer
description: >-
Number of files that have been successfully processed
cancelled:
type: integer
description: >-
Number of files that had their processing cancelled
failed:
type: integer
description: Number of files that failed to process
in_progress:
type: integer
description: >-
Number of files currently being processed
total:
type: integer
description: >-
Total number of files in the vector store
additionalProperties: false
required:
- completed
- cancelled
- failed
- in_progress
- total
title: VectorStoreFileCounts
description: >-
File processing status counts for a vector store.
VectorStoreObject:
type: object
properties:
@ -11538,6 +11770,36 @@ components:
- metadata
title: VectorStoreObject
description: OpenAI Vector Store object.
OpenaiCreateVectorStoreFileBatchRequest:
type: object
properties:
file_ids:
type: array
items:
type: string
description: >-
A list of File IDs that the vector store should use.
attributes:
type: object
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) Key-value attributes to store with the files.
chunking_strategy:
$ref: '#/components/schemas/VectorStoreChunkingStrategy'
description: >-
(Optional) The chunking strategy used to chunk the file(s). Defaults to
auto.
additionalProperties: false
required:
- file_ids
title: OpenaiCreateVectorStoreFileBatchRequest
OpenAIFileDeleteResponse:
type: object
properties:
@ -11841,6 +12103,40 @@ components:
title: VectorStoreListFilesResponse
description: >-
Response from listing files in a vector store.
VectorStoreFilesListInBatchResponse:
type: object
properties:
object:
type: string
default: list
description: Object type identifier, always "list"
data:
type: array
items:
$ref: '#/components/schemas/VectorStoreFileObject'
description: >-
List of vector store file objects in the batch
first_id:
type: string
description: >-
(Optional) ID of the first file in the list for pagination
last_id:
type: string
description: >-
(Optional) ID of the last file in the list for pagination
has_more:
type: boolean
default: false
description: >-
Whether there are more files available beyond this page
additionalProperties: false
required:
- object
- data
- has_more
title: VectorStoreFilesListInBatchResponse
description: >-
Response from listing files in a vector store file batch.
VectorStoreListResponse:
type: object
properties: