8 writes to Services
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvokingChatClient.cs (1)
1029
Arguments = new(callContent.Arguments) {
Services
= FunctionInvocationServices },
Microsoft.Extensions.AI.Abstractions.Tests (1)
Functions\AIFunctionArgumentsTests.cs (1)
55
Services
= sp
Microsoft.Extensions.AI.Tests (6)
Functions\AIFunctionFactoryTest.cs (6)
439
arguments.
Services
= sp;
493
var result = (Tuple<MyFunctionTypeWithOneArg, MyArgumentType>?)await func.InvokeAsync(new() {
Services
= sp });
606
var result = await f.InvokeAsync(new() { ["myInteger"] = 1,
Services
= sp });
629
var result = await f.InvokeAsync(new() { ["myInteger"] = 1,
Services
= sp });
652
result = await f.InvokeAsync(new() { ["myInteger"] = 1,
Services
= sp });
720
var result = await f.InvokeAsync(new() {
Services
= sp1 });
27 references to Services
Microsoft.Extensions.AI.Abstractions (17)
Functions\AIFunctionFactory.cs (17)
59
/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.
Services
"/> property
61
/// <see cref="AIFunctionArguments.
Services
"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.
Services
"/>
146
/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.
Services
"/> property
148
/// <see cref="AIFunctionArguments.
Services
"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.
Services
"/>
229
/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.
Services
"/> property
231
/// <see cref="AIFunctionArguments.
Services
"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.
Services
"/>
323
/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.
Services
"/> property
325
/// <see cref="AIFunctionArguments.
Services
"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.
Services
"/>
419
/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.
Services
"/> property
421
/// <see cref="AIFunctionArguments.
Services
"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.
Services
"/>
850
IServiceProvider? services = arguments.
Services
;
923
Throw.ArgumentNullException($"arguments.{nameof(AIFunctionArguments.
Services
)}", $"Services are required for parameter '{parameterName}'.");
Microsoft.Extensions.AI.Abstractions.Tests (7)
Functions\AIFunctionArgumentsTests.cs (7)
18
Assert.Null(args.
Services
);
29
Assert.Null(args.
Services
);
43
Assert.Null(args.
Services
);
58
Assert.Same(sp, args.
Services
);
178
Assert.Null(args.
Services
);
194
Assert.Null(args.
Services
);
216
Assert.Null(args.
Services
);
Microsoft.Extensions.AI.Tests (3)
Functions\AIFunctionFactoryTest.cs (3)
487
Assert.NotNull(arguments.
Services
);
488
return ActivatorUtilities.CreateInstance(arguments.
Services
, typeof(MyFunctionTypeWithOneArg));
1169
(a.
Services
as IKeyedServiceProvider)?.GetKeyedService(p.ParameterType, attr.Key) is { } s ? s :