TsgcHTTP_API_OpenAI › Methods › CreateVectorStore
Creates a new vector store used by the file_search tool
function CreateVectorStore(const aRequest : TsgcOpenAIClass_Request_VectorStore): TsgcOpenAIClass_VectorStore;
| Name | Type | Description |
|---|---|---|
aRequest | const TsgcOpenAIClass_Request_VectorStore | Vector store configuration: name, initial file ids, chunking strategy, expiration policy and metadata. |
The newly created vector store together with its id and processing status (TsgcOpenAIClass_VectorStore)
Calls POST /v1/vector_stores to provision a searchable vector store that an Assistant can query through the file_search tool. Files can be attached at creation time via FileIds, or added later with CreateVectorStoreFile/CreateVectorStoreFileBatch. The returned id (e.g. vs_abc123) should be referenced from the Assistant or Thread tool resources.
var oRequest: TsgcOpenAIClass_Request_VectorStore;
begin
oRequest := TsgcOpenAIClass_Request_VectorStore.Create;
try
oRequest.Name := 'Product Manuals';
ShowMessage(oAPI.CreateVectorStore(oRequest).Id);
finally
oRequest.Free;
end;
end;