9 writes to Services
Microsoft.Extensions.AI (2)
ChatCompletion\FunctionInvokingChatClient.cs (1)
1181Arguments = new(callContent.Arguments) { Services = FunctionInvocationServices },
Realtime\FunctionInvokingRealtimeClientSession.cs (1)
334Arguments = 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)
670arguments.Services = sp; 724var result = (Tuple<MyFunctionTypeWithOneArg, MyArgumentType>?)await func.InvokeAsync(new() { Services = sp }); 837var result = await f.InvokeAsync(new() { ["myInteger"] = 1, Services = sp }); 860var result = await f.InvokeAsync(new() { ["myInteger"] = 1, Services = sp }); 883result = await f.InvokeAsync(new() { ["myInteger"] = 1, Services = sp }); 951var result = await f.InvokeAsync(new() { Services = sp1 });
27 references to Services
Microsoft.Extensions.AI.Abstractions (17)
Functions\AIFunctionFactory.cs (17)
70/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.Services"/> property 72/// <see cref="AIFunctionArguments.Services"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.Services"/> 159/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.Services"/> property 161/// <see cref="AIFunctionArguments.Services"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.Services"/> 241/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.Services"/> property 243/// <see cref="AIFunctionArguments.Services"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.Services"/> 338/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.Services"/> property 340/// <see cref="AIFunctionArguments.Services"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.Services"/> 433/// By default, <see cref="IServiceProvider"/> parameters are bound from the <see cref="AIFunctionArguments.Services"/> property 435/// <see cref="AIFunctionArguments.Services"/> is allowed to be <see langword="null"/>; otherwise, <see cref="AIFunctionArguments.Services"/> 949IServiceProvider? services = arguments.Services; 1023Throw.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)
718Assert.NotNull(arguments.Services); 719return ActivatorUtilities.CreateInstance(arguments.Services, typeof(MyFunctionTypeWithOneArg)); 1400(a.Services as IKeyedServiceProvider)?.GetKeyedService(p.ParameterType, attr.Key) is { } s ? s :