OpenAIAssistantAgentThread.GetMessagesAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Asynchronously retrieves all messages in the thread.
public System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent> GetMessagesAsync(OpenAI.Assistants.MessageCollectionOrder? sortOrder = default, System.Threading.CancellationToken cancellationToken = default);
member this.GetMessagesAsync : Nullable<OpenAI.Assistants.MessageCollectionOrder> * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent>
Public Function GetMessagesAsync (Optional sortOrder As Nullable(Of MessageCollectionOrder) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ChatMessageContent)
Parameters
- sortOrder
- Nullable<OpenAI.Assistants.MessageCollectionOrder>
The order to return messages in.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.
Returns
The messages in the thread.
Exceptions
The thread has been deleted.