TsgcHTTP_API_OpenAI › Methods › CreateVectorStoreFile
Attaches an uploaded file to a vector store for indexing
function CreateVectorStoreFile(const aVectorStoreId, aFileId: string) : TsgcOpenAIClass_VectorStoreFile;
| Name | Type | Description |
|---|---|---|
aVectorStoreId | const string | The identifier of the vector store that should receive the file. |
aFileId | const string | The identifier of a file previously uploaded via UploadFile (e.g. file_abc123). |
The VectorStoreFile association with its initial indexing Status (TsgcOpenAIClass_VectorStoreFile)
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.
var oFile: TsgcOpenAIClass_VectorStoreFile;
begin
oFile := oAPI.CreateVectorStoreFile('vs_abc123', 'file_abc123');
ShowMessage(oFile.Id + ' / ' + oFile.Status);
end;