Share via


AIFunction.InvokeAsync(AIFunctionArguments, CancellationToken) Method

Definition

Invokes the AIFunction and returns its result.

public System.Threading.Tasks.ValueTask<object?> InvokeAsync(Microsoft.Extensions.AI.AIFunctionArguments? arguments = default, System.Threading.CancellationToken cancellationToken = default);
member this.InvokeAsync : Microsoft.Extensions.AI.AIFunctionArguments * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<obj>
Public Function InvokeAsync (Optional arguments As AIFunctionArguments = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Object)

Parameters

arguments
AIFunctionArguments

The arguments to pass to the function's invocation.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

The result of the function's execution.

Applies to