TsgcHTTP_API_OpenAI › Methods › ListRunSteps
Lists the execution steps that make up a Run
function ListRunSteps(const aThreadId, aRunId: string; const aLimit: Integer = 20; aOrder: string = ''; aAfter: string = ''; aBefore: string = ''): TsgcOpenAIClass_Response_List_RunSteps;
| Name | Type | Description |
|---|---|---|
aThreadId | const string | The identifier of the Thread that owns the Run. |
aRunId | const string | The identifier of the Run whose steps are being listed. |
aLimit | const Integer | Maximum number of steps to return (1-100, defaults to 20). |
aOrder | string | Sort order by created_at: asc or desc. |
aAfter | string | Cursor for forward pagination; pass the last step id from the previous page. |
aBefore | string | Cursor for backward pagination; pass the first step id from the previous page. |
Paginated list of RunStep objects describing message creation and tool calls performed by the Run (TsgcOpenAIClass_Response_List_RunSteps)
Calls GET /v1/threads/{thread_id}/runs/{run_id}/steps. Each step describes one action taken during the Run, such as creating a message or invoking a tool. Useful for auditing or debugging Assistant behaviour.
var oList: TsgcOpenAIClass_Response_List_RunSteps;
i: Integer;
begin
oList := oAPI.ListRunSteps('thread_abc123', 'run_abc123', 20, 'asc');
for i := 0 to oList.Data.Count - 1 do
Memo1.Lines.Add(oList.Data[i].Id + ' - ' + oList.Data[i].StepType);
end;