TsgcHTTP_API_OpenAIMethods › DeleteThread

DeleteThread Method

Permanently deletes a Thread and all of its messages

Syntax

function DeleteThread(const aThreadId: string) : TsgcOpenAIClass_Response_Delete_Status;

Parameters

NameTypeDescription
aThreadIdconst stringThe identifier of the Thread to delete.

Return Value

Deletion confirmation with the Thread id and a boolean Deleted flag (TsgcOpenAIClass_Response_Delete_Status)

Remarks

Calls DELETE /v1/threads/{thread_id} to permanently remove the Thread together with every message it contains. Runs previously executed against the Thread remain available but can no longer be listed or resumed. This operation cannot be undone.

Example

begin
  if oAPI.DeleteThread('thread_abc123').Deleted then
    ShowMessage('Thread removed');
end;

Back to Methods