14 references to GetService
Microsoft.Extensions.AI (3)
ChatCompletion\FunctionInvokingChatClient.cs (3)
536
.Where(t => t.
GetService
<ApprovalRequiredAIFunction>() is not null)
738
anyRequireApproval |= tool.
GetService
<ApprovalRequiredAIFunction>() is not null;
1553
if (t.Value.
GetService
<ApprovalRequiredAIFunction>() is { } araf && araf.Name == functionCall.Name)
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)
1207
Assert.Same(rawSearchTool, options.Tools[0].
GetService
<ResponseTool>());
1208
Assert.Same(rawSearchTool, options.Tools[0].
GetService
<WebSearchTool>());
1209
Assert.Null(options.Tools[0].
GetService
<ResponseTool>("key"));