TsgcHTTP_API_OpenAIMethods › RetrieveThread

RetrieveThread Method

Retrieves a Thread definition by its identifier

Syntax

function RetrieveThread(const aThreadId: string): TsgcOpenAIClass_Thread;

Parameters

NameTypeDescription
aThreadIdconst stringThe identifier of the Thread to retrieve (e.g. thread_abc123).

Return Value

The Thread object exposing its tool resources and metadata (TsgcOpenAIClass_Thread)

Remarks

Calls GET /v1/threads/{thread_id} to obtain the metadata and tool resources attached to a Thread. The Thread object itself does not contain the messages; call ListMessages to enumerate the conversation contents.

Example

var oThread: TsgcOpenAIClass_Thread;
begin
  oThread := oAPI.RetrieveThread('thread_abc123');
  ShowMessage(oThread.Id);
end;

Back to Methods