IOpenAIClient.WaitForRunToCompleteAsync

IOpenAIClient.WaitForRunToCompleteAsync method

Waits for a run to complete within a thread asynchronously.

public Task<RunResponse> WaitForRunToCompleteAsync(string threadId, string runId, 
    CancellationToken? cancellationToken = default)
ParameterTypeDescription
threadIdStringThe ID of the thread containing the run.
runIdStringThe ID of the run 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 run.

Exceptions

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

See Also