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