OpenAIClient.WaitForThreadMessageToCompleteAsync

OpenAIClient.WaitForThreadMessageToCompleteAsync method

Waits for a specific thread message to complete asynchronously.

public Task<ThreadMessageResponse> WaitForThreadMessageToCompleteAsync(string threadId, 
    string threadMessageId, CancellationToken? cancellationToken = default)
ParameterTypeDescription
threadIdStringThe ID of the thread containing the message.
threadMessageIdStringThe ID of the message to monitor until completion.
cancellationTokenNullable`1A token to cancel the operation.

Return Value

A task that represents the asynchronous operation. The task result contains the final status of the message.

Exceptions

exceptioncondition
AIClientExceptionThrown when the thread Id is null or empty.
AIClientExceptionThrown when the thread message Id is null or empty.

See Also