TsgcHTTP_API_OpenAIMethods › RetrieveVectorStoreFileBatch

RetrieveVectorStoreFileBatch Method

Retrieves a vector store file batch by its identifier

Syntax

function RetrieveVectorStoreFileBatch(const aVectorStoreId, aBatchId: string): TsgcOpenAIClass_VectorStoreFileBatch;

Parameters

NameTypeDescription
aVectorStoreIdconst stringThe identifier of the vector store that owns the batch.
aBatchIdconst stringThe identifier of the file batch to retrieve (e.g. vsfb_abc123).

Return Value

The file batch object with its current Status and FileCounts breakdown (TsgcOpenAIClass_VectorStoreFileBatch)

Remarks

Calls GET /v1/vector_stores/{vector_store_id}/file_batches/{batch_id} to observe the progress of a batch. Poll until Status reaches completed, cancelled or failed; FileCounts shows how many files are still in_progress versus completed or failed.

Example

var oBatch: TsgcOpenAIClass_VectorStoreFileBatch;
begin
  oBatch := oAPI.RetrieveVectorStoreFileBatch('vs_abc123', 'vsfb_abc123');
  ShowMessage(oBatch.Status + ' - completed: ' + IntToStr(oBatch.FileCounts.Completed));
end;

Back to Methods