Share via


FunctionInvokingChatClient.FunctionInvoker Property

Definition

Gets or sets a delegate used to invoke AIFunction instances.

public:
 property Func<Microsoft::Extensions::AI::FunctionInvocationContext ^, System::Threading::CancellationToken, System::Threading::Tasks::ValueTask<System::Object ^>> ^ FunctionInvoker { Func<Microsoft::Extensions::AI::FunctionInvocationContext ^, System::Threading::CancellationToken, System::Threading::Tasks::ValueTask<System::Object ^>> ^ get(); void set(Func<Microsoft::Extensions::AI::FunctionInvocationContext ^, System::Threading::CancellationToken, System::Threading::Tasks::ValueTask<System::Object ^>> ^ value); };
public Func<Microsoft.Extensions.AI.FunctionInvocationContext,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<object?>>? FunctionInvoker { get; set; }
member this.FunctionInvoker : Func<Microsoft.Extensions.AI.FunctionInvocationContext, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<obj>> with get, set
Public Property FunctionInvoker As Func(Of FunctionInvocationContext, CancellationToken, ValueTask(Of Object))

Property Value

Remarks

By default, the protected InvokeFunctionAsync(FunctionInvocationContext, CancellationToken) method is called for each AIFunction to be invoked, invoking the instance and returning its result. If this delegate is set to a non-null value, InvokeFunctionAsync(FunctionInvocationContext, CancellationToken) will replace its normal invocation with a call to this delegate, enabling this delegate to assume all invocation handling of the function.

Applies to