TsgcHTTP_API_OpenAIMethods › RetrieveVectorStoreFile

RetrieveVectorStoreFile Method

Retrieves the status of a file attached to a vector store

Syntax

function RetrieveVectorStoreFile(const aVectorStoreId, aFileId: string) : TsgcOpenAIClass_VectorStoreFile;

Parameters

NameTypeDescription
aVectorStoreIdconst stringThe identifier of the vector store that contains the file.
aFileIdconst stringThe identifier of the file within the vector store.

Return Value

The VectorStoreFile object with its current indexing Status and any processing errors (TsgcOpenAIClass_VectorStoreFile)

Remarks

Calls GET /v1/vector_stores/{vector_store_id}/files/{file_id} to inspect the indexing state of a single file. Poll until Status is completed before relying on the file for search, or read LastError when it reports failed.

Example

var oFile: TsgcOpenAIClass_VectorStoreFile;
begin
  oFile := oAPI.RetrieveVectorStoreFile('vs_abc123', 'file_abc123');
  ShowMessage(oFile.Id + ' / ' + oFile.Status);
end;

Back to Methods