2 instantiations of AIFunctionContext
Microsoft.Extensions.AI (1)
Functions\AIFunctionFactory.cs (1)
304new() { 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/// an <see cref="AIFunctionContext"/> parameter is passed specially by the <see cref="AIFunction"/> implementation 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)
174private readonly Func<IReadOnlyDictionary<string, object?>, AIFunctionContext?, object?>[] _parameterMarshallers; 252_parameterMarshallers = new Func<IReadOnlyDictionary<string, object?>, AIFunctionContext?, object?>[parameters.Length]; 303AIFunctionContext? context = _needsAIFunctionContext ? 342out Func<IReadOnlyDictionary<string, object?>, AIFunctionContext?, object?> marshaller) 350if (parameter.ParameterType == typeof(AIFunctionContext)) 354Throw.ArgumentException(nameof(parameter), $"Only one {nameof(AIFunctionContext)} parameter is permitted."); 372marshaller = (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) =>