8 writes to Services
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvokingChatClient.cs (1)
1150Arguments = new(callContent.Arguments) { Services = FunctionInvocationServices },
Microsoft.Extensions.AI.Abstractions.Tests (1)
Functions\AIFunctionArgumentsTests.cs (1)
55Services = sp
Microsoft.Extensions.AI.Tests (6)
Functions\AIFunctionFactoryTest.cs (6)
440arguments.Services = sp; 494var result = (Tuple<MyFunctionTypeWithOneArg, MyArgumentType>?)await func.InvokeAsync(new() { Services = sp }); 607var result = await f.InvokeAsync(new() { ["myInteger"] = 1, Services = sp }); 630var result = await f.InvokeAsync(new() { ["myInteger"] = 1, Services = sp }); 653result = await f.InvokeAsync(new() { ["myInteger"] = 1, Services = sp }); 721var result = await f.InvokeAsync(new() { Services = sp1 });
27 references to Services
Microsoft.Extensions.AI.Abstractions (17)
Functions\AIFunctionFactory.cs (17)
56/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.Services"/> property 58/// <see cref="AIFunctionArguments.Services"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.Services"/> 137/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.Services"/> property 139/// <see cref="AIFunctionArguments.Services"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.Services"/> 214/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.Services"/> property 216/// <see cref="AIFunctionArguments.Services"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.Services"/> 302/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.Services"/> property 304/// <see cref="AIFunctionArguments.Services"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.Services"/> 392/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.Services"/> property 394/// <see cref="AIFunctionArguments.Services"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.Services"/> 820IServiceProvider? services = arguments.Services; 893Throw.ArgumentNullException($"arguments.{nameof(AIFunctionArguments.Services)}", $"Services are required for parameter '{parameterName}'.");
Microsoft.Extensions.AI.Abstractions.Tests (7)
Functions\AIFunctionArgumentsTests.cs (7)
18Assert.Null(args.Services); 29Assert.Null(args.Services); 43Assert.Null(args.Services); 58Assert.Same(sp, args.Services); 178Assert.Null(args.Services); 194Assert.Null(args.Services); 216Assert.Null(args.Services);
Microsoft.Extensions.AI.Tests (3)
Functions\AIFunctionFactoryTest.cs (3)
488Assert.NotNull(arguments.Services); 489return ActivatorUtilities.CreateInstance(arguments.Services, typeof(MyFunctionTypeWithOneArg)); 1170(a.Services as IKeyedServiceProvider)?.GetKeyedService(p.ParameterType, attr.Key) is { } s ? s :