TsgcHTTP_API_OpenAI › Methods › RetrieveMessage
Retrieves a single message from a Thread by its identifier
function RetrieveMessage(const aThreadId, aMessageId: string) : TsgcOpenAIClass_Message;
| Name | Type | Description |
|---|---|---|
aThreadId | const string | The identifier of the Thread that owns the message. |
aMessageId | const string | The identifier of the message to retrieve (e.g. msg_abc123). |
The Message object with its role, content parts, attachments and metadata (TsgcOpenAIClass_Message)
Calls GET /v1/threads/{thread_id}/messages/{message_id} to return the full representation of a single message, including any file citations or generated images. Use this call when you need to inspect a specific message without paging the whole Thread.
var oMessage: TsgcOpenAIClass_Message;
begin
oMessage := oAPI.RetrieveMessage('thread_abc123', 'msg_abc123');
ShowMessage(oMessage.ContentAsText);
end;