IToolReductionStrategy.SelectToolsForRequestAsync 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.
Selects the tools that should be included for a specific request.
public System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.AITool>> SelectToolsForRequestAsync(System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage> messages, Microsoft.Extensions.AI.ChatOptions? options, System.Threading.CancellationToken cancellationToken = default);
abstract member SelectToolsForRequestAsync : seq<Microsoft.Extensions.AI.ChatMessage> * Microsoft.Extensions.AI.ChatOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<seq<Microsoft.Extensions.AI.AITool>>
Public Function SelectToolsForRequestAsync (messages As IEnumerable(Of ChatMessage), options As ChatOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IEnumerable(Of AITool))
Parameters
- messages
- IEnumerable<ChatMessage>
The chat messages for the request. This is an IEnumerable<T> to avoid premature materialization.
- options
- ChatOptions
The chat options for the request (may be null).
- cancellationToken
- CancellationToken
A token to observe cancellation.
Returns
A (possibly reduced) enumerable of AITool instances. Must never be null.
Returning the same instance referenced by options.Tools signals no change.