15 references to GetService
Microsoft.Extensions.AI (4)
ChatCompletion\FunctionInvokingChatClient.cs (3)
362.Where(t => t.GetService<ApprovalRequiredAIFunction>() is not null) 584.Where(t => t.GetService<ApprovalRequiredAIFunction>() is not null) 811if (toolList[i].GetService<ApprovalRequiredAIFunction>() is not null)
Common\OtelMessageParts.cs (1)
100if (tool.GetService<AIFunctionDeclaration>() is { } function)
Microsoft.Extensions.AI.Abstractions.Tests (8)
Functions\DelegatingAIFunctionTests.cs (1)
35Assert.Same(expected, actual.GetService<ApprovalRequiredAIFunction>());
Tools\AIToolTests.cs (7)
32Assert.Same(tool, tool.GetService<object>()); 33Assert.Same(tool, tool.GetService<AITool>()); 34Assert.Same(tool, tool.GetService<DerivedAITool>()); 37Assert.Null(tool.GetService<string>()); 38Assert.Null(tool.GetService<object>("key")); 39Assert.Null(tool.GetService<AITool>("key")); 40Assert.Null(tool.GetService<DerivedAITool>("key"));
Microsoft.Extensions.AI.OpenAI.Tests (3)
OpenAIConversionTests.cs (3)
2254Assert.Same(rawSearchTool, options.Tools[0].GetService<ResponseTool>()); 2255Assert.Same(rawSearchTool, options.Tools[0].GetService<WebSearchTool>()); 2256Assert.Null(options.Tools[0].GetService<ResponseTool>("key"));