TsgcHTTP_API_OpenAI › Methods › RetrieveThread
Retrieves a Thread definition by its identifier
function RetrieveThread(const aThreadId: string): TsgcOpenAIClass_Thread;
| Name | Type | Description |
|---|---|---|
aThreadId | const string | The identifier of the Thread to retrieve (e.g. thread_abc123). |
The Thread object exposing its tool resources and metadata (TsgcOpenAIClass_Thread)
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.
var oThread: TsgcOpenAIClass_Thread;
begin
oThread := oAPI.RetrieveThread('thread_abc123');
ShowMessage(oThread.Id);
end;