TsgcHTTP_API_OpenAIMethods › CreateVectorStoreFile

CreateVectorStoreFile Method

Attaches an uploaded file to a vector store for indexing

Syntax

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

Parameters

NameTypeDescription
aVectorStoreIdconst stringThe identifier of the vector store that should receive the file.
aFileIdconst stringThe identifier of a file previously uploaded via UploadFile (e.g. file_abc123).

Return Value

The VectorStoreFile association with its initial indexing Status (TsgcOpenAIClass_VectorStoreFile)

Remarks

Calls POST /v1/vector_stores/{vector_store_id}/files to start indexing an already-uploaded file inside the target vector store. Processing runs asynchronously; poll RetrieveVectorStoreFile until Status becomes completed before relying on the file for file_search.

Example

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

Back to Methods