TsgcHTTP_API_OpenAI › Methods › DeleteMessage
Deletes a specific message from a Thread
function DeleteMessage(const aThreadId, aMessageId: string) : TsgcOpenAIClass_Response_Delete_Status;
| Name | Type | Description |
|---|---|---|
aThreadId | const string | The identifier of the Thread that owns the message. |
aMessageId | const string | The identifier of the message to delete. |
Deletion confirmation with the message id and a boolean Deleted flag (TsgcOpenAIClass_Response_Delete_Status)
Calls DELETE /v1/threads/{thread_id}/messages/{message_id} to remove a single message from a Thread. The rest of the conversation history is preserved. The operation cannot be undone.
begin
if oAPI.DeleteMessage('thread_abc123', 'msg_abc123').Deleted then
ShowMessage('Message removed');
end;