TsgcHTTP_API_OpenAI › Methods › ModifyThread
Updates the tool resources and metadata of an existing Thread
function ModifyThread(const aThreadId: string; const aRequest: TsgcOpenAIClass_Request_Thread): TsgcOpenAIClass_Thread;
| Name | Type | Description |
|---|---|---|
aThreadId | const string | The identifier of the Thread to modify. |
aRequest | const TsgcOpenAIClass_Request_Thread | Fields to update: tool resources (code interpreter files, vector store ids) and metadata. |
The updated Thread object (TsgcOpenAIClass_Thread)
Calls POST /v1/threads/{thread_id} to update the Thread's tool resources and metadata. Messages belonging to the Thread are not affected. Only fields present in the request are changed.
var oRequest: TsgcOpenAIClass_Request_Thread;
begin
oRequest := TsgcOpenAIClass_Request_Thread.Create;
try
oRequest.Metadata.Values['project'] := 'invoices';
oAPI.ModifyThread('thread_abc123', oRequest);
finally
oRequest.Free;
end;
end;