2 instantiations of AIFunctionContext
Microsoft.Extensions.AI (1)
Functions\AIFunctionFactory.cs (1)
304
new
() { CancellationToken = cancellationToken } :
Microsoft.Extensions.AI.Tests (1)
Functions\AIFunctionFactoryTest.cs (1)
72
AssertExtensions.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)
174
private readonly Func<IReadOnlyDictionary<string, object?>,
AIFunctionContext
?, object?>[] _parameterMarshallers;
252
_parameterMarshallers = new Func<IReadOnlyDictionary<string, object?>,
AIFunctionContext
?, object?>[parameters.Length];
303
AIFunctionContext
? context = _needsAIFunctionContext ?
342
out Func<IReadOnlyDictionary<string, object?>,
AIFunctionContext
?, object?> marshaller)
350
if (parameter.ParameterType == typeof(
AIFunctionContext
))
354
Throw.ArgumentException(nameof(parameter), $"Only one {nameof(
AIFunctionContext
)} parameter is permitted.");
372
marshaller = (IReadOnlyDictionary<string, object?> arguments,
AIFunctionContext
? _) =>
Microsoft.Extensions.AI.Tests (3)
Functions\AIFunctionFactoryTest.cs (3)
57
func = AIFunctionFactory.Create((
AIFunctionContext
ctx) =>
67
func = AIFunctionFactory.Create((int somethingFirst,
AIFunctionContext
ctx) =>
77
func = AIFunctionFactory.Create((
AIFunctionContext
ctx, int somethingAfter = 0) =>