OpenAIClient.WaitForAssistantMessageAsync
OpenAIClient.WaitForAssistantMessageAsync method
Waits for the first message from the assistant within a thread asynchronously.
public Task<ThreadMessageResponse> WaitForAssistantMessageAsync(string threadId,
ThreadMessageListQueryParameters queryParameters = null,
CancellationToken? cancellationToken = default)
| Parameter | Type | Description |
|---|---|---|
| threadId | String | The ID of the thread to monitor for the first assistant message. |
| queryParameters | ThreadMessageListQueryParameters | Optional query parameters to filter the list of messages. |
| cancellationToken | Nullable`1 | A token to cancel the operation. |
Return Value
A task that represents the asynchronous operation. The task result contains the first assistant message in the thread.
Exceptions
| exception | condition |
|---|---|
| AIClientException | Thrown when the thread Id is null or empty. |
See Also
- class ThreadMessageResponse
- class ThreadMessageListQueryParameters
- class OpenAIClient
- namespace Aspose.Pdf.AI
- assembly Aspose.PDF