2 instantiations of AIFunctionContext
Microsoft.Extensions.AI (1)
Functions\AIFunctionFactory.cs (1)
240new() { CancellationToken = cancellationToken } :
Microsoft.Extensions.AI.Tests (1)
Functions\AIFunctionFactoryTest.cs (1)
72AssertExtensions.EqualFunctionCallResults(null, await func.InvokeAsync(new Dictionary<string, object?> { ["somethingFirst"] = 1, ["ctx"] = new AIFunctionContext() }, cts.Token));
14 references to AIFunctionContext
Microsoft.Extensions.AI (11)
Functions\AIFunctionContext.cs (4)
12/// of type <see cref="AIFunctionContext"/>. Whereas all other parameters are passed by name from the supplied collection of arguments, 13/// a <see cref="AIFunctionContext"/> parameter is passed specially by the <see cref="AIFunction"/> implementation, in order to pass relevant 15/// method is available from the <see cref="AIFunctionContext.CancellationToken"/> property. 19/// <summary>Initializes a new instance of the <see cref="AIFunctionContext"/> class.</summary>
Functions\AIFunctionFactory.cs (7)
110private readonly Func<IReadOnlyDictionary<string, object?>, AIFunctionContext?, object?>[] _parameterMarshallers; 188_parameterMarshallers = new Func<IReadOnlyDictionary<string, object?>, AIFunctionContext?, object?>[parameters.Length]; 239AIFunctionContext? context = _needsAIFunctionContext ? 278out Func<IReadOnlyDictionary<string, object?>, AIFunctionContext?, object?> marshaller) 286if (parameter.ParameterType == typeof(AIFunctionContext)) 290Throw.ArgumentException(nameof(parameter), $"Only one {nameof(AIFunctionContext)} parameter is permitted."); 308marshaller = (IReadOnlyDictionary<string, object?> arguments, AIFunctionContext? _) =>
Microsoft.Extensions.AI.Tests (3)
Functions\AIFunctionFactoryTest.cs (3)
57func = AIFunctionFactory.Create((AIFunctionContext ctx) => 67func = AIFunctionFactory.Create((int somethingFirst, AIFunctionContext ctx) => 77func = AIFunctionFactory.Create((AIFunctionContext ctx, int somethingAfter = 0) =>