TsgcHTTP_API_OpenAI › Methods › ModifyRun
Updates the metadata of an existing Run
function ModifyRun(const aThreadId, aRunId: string; const aRun: TsgcOpenAIClass_Request_Run): TsgcOpenAIClass_Run;
| Name | Type | Description |
|---|---|---|
aThreadId | const string | The identifier of the Thread that owns the Run. |
aRunId | const string | The identifier of the Run to modify. |
aRun | const TsgcOpenAIClass_Request_Run | Request whose Metadata collection contains the key/value pairs to update. |
The updated Run object reflecting the new metadata (TsgcOpenAIClass_Run)
Calls POST /v1/threads/{thread_id}/runs/{run_id}. Only the metadata field is mutable; the Run's execution state, model and tools cannot be changed after creation. Use it to tag Runs with application-specific identifiers.
var oRequest: TsgcOpenAIClass_Request_Run;
begin
oRequest := TsgcOpenAIClass_Request_Run.Create;
try
oRequest.Metadata.Values['trace_id'] := 'abc-42';
oAPI.ModifyRun('thread_abc123', 'run_abc123', oRequest);
finally
oRequest.Free;
end;
end;