MessageCountingChatReducer.ReduceAsync 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.
Reduces the size of a list of chat messages.
public:
 virtual System::Threading::Tasks::Task<System::Collections::Generic::IEnumerable<Microsoft::Extensions::AI::ChatMessage ^> ^> ^ ReduceAsync(System::Collections::Generic::IEnumerable<Microsoft::Extensions::AI::ChatMessage ^> ^ messages, System::Threading::CancellationToken cancellationToken);
	public System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage>> ReduceAsync(System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage> messages, System.Threading.CancellationToken cancellationToken);
	abstract member ReduceAsync : seq<Microsoft.Extensions.AI.ChatMessage> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<seq<Microsoft.Extensions.AI.ChatMessage>>
override this.ReduceAsync : seq<Microsoft.Extensions.AI.ChatMessage> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<seq<Microsoft.Extensions.AI.ChatMessage>>
	Public Function ReduceAsync (messages As IEnumerable(Of ChatMessage), cancellationToken As CancellationToken) As Task(Of IEnumerable(Of ChatMessage))
	Parameters
- messages
 - IEnumerable<ChatMessage>
 
The messages to reduce.
- cancellationToken
 - CancellationToken
 
The CancellationToken to monitor for cancellation requests.
Returns
The new list of messages.