TsgcHTTP_API_OpenAIMethods › CreateVectorStoreFileBatch

CreateVectorStoreFileBatch Method

Attaches multiple files to a vector store in a single batch operation

Syntax

function CreateVectorStoreFileBatch(const aVectorStoreId, aFileIds: string) : TsgcOpenAIClass_VectorStoreFileBatch;

Parameters

NameTypeDescription
aVectorStoreIdconst stringThe identifier of the vector store that should receive the files.
aFileIdsconst stringComma-separated list of file ids (e.g. file_abc,file_def) previously uploaded through UploadFile.

Return Value

The newly created file batch object with its id, status and file counts (TsgcOpenAIClass_VectorStoreFileBatch)

Remarks

Calls POST /v1/vector_stores/{vector_store_id}/file_batches to attach up to 500 files at once and queue them for indexing. Indexing happens asynchronously; poll RetrieveVectorStoreFileBatch to track completion or list files with ListVectorStoreFilesBatch.

Example

var oBatch: TsgcOpenAIClass_VectorStoreFileBatch;
begin
  oBatch := oAPI.CreateVectorStoreFileBatch('vs_abc123', 'file_a,file_b,file_c');
  ShowMessage('Batch ' + oBatch.Id + ' - ' + oBatch.Status);
end;

Back to Methods