TsgcHTTP_API_OpenAIMethods › ModifyThread

ModifyThread Method

Updates the tool resources and metadata of an existing Thread

Syntax

function ModifyThread(const aThreadId: string; const aRequest: TsgcOpenAIClass_Request_Thread): TsgcOpenAIClass_Thread;

Parameters

NameTypeDescription
aThreadIdconst stringThe identifier of the Thread to modify.
aRequestconst TsgcOpenAIClass_Request_ThreadFields to update: tool resources (code interpreter files, vector store ids) and metadata.

Return Value

The updated Thread object (TsgcOpenAIClass_Thread)

Remarks

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.

Example

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;

Back to Methods