IFoundryToolRuntime.InvokeAsync 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.
Convenience method to invoke a tool directly by its definition.
public System.Threading.Tasks.Task<object?> InvokeAsync(object tool, System.Collections.Generic.IDictionary<string,object?>? arguments = default, System.Threading.CancellationToken cancellationToken = default);
abstract member InvokeAsync : obj * System.Collections.Generic.IDictionary<string, obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
Public Function InvokeAsync (tool As Object, Optional arguments As IDictionary(Of String, Object) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
Parameters
- tool
- Object
The tool definition. This can be a FoundryTool instance or a dictionary-based facade that will be converted to a FoundryTool using FoundryToolFactory.
- arguments
- IDictionary<String,Object>
The arguments to pass to the tool invocation, or null for no arguments.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
A task representing the asynchronous operation. The task result contains the tool invocation result.