39 references to GetService
Aspire.Azure.AI.OpenAI.Tests (1)
AspireAzureOpenAIClientBuilderChatClientExtensionsTests.cs (1)
190
Assert.Equal(disableOpenTelemetry, client.
GetService
<OpenTelemetryChatClient>() is null);
Aspire.OpenAI.Tests (1)
AspireOpenAIClientBuilderChatClientExtensionsTests.cs (1)
191
Assert.Equal(disableOpenTelemetry, client.
GetService
<OpenTelemetryChatClient>() is null);
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvokingChatClient.cs (1)
62
_activitySource = innerClient.
GetService
<ActivitySource>();
Microsoft.Extensions.AI.Abstractions.Tests (1)
ChatCompletion\ChatClientExtensionsTests.cs (1)
17
Assert.Throws<ArgumentNullException>("client", () => ChatClientExtensions.
GetService
<object>(null!));
Microsoft.Extensions.AI.AzureAIInference.Tests (9)
AzureAIInferenceChatClientTests.cs (9)
75
Assert.Same(chatClient, chatClient.
GetService
<IChatClient>());
76
Assert.Same(chatClient, chatClient.
GetService
<AzureAIInferenceChatClient>());
78
Assert.Same(client, chatClient.
GetService
<ChatCompletionsClient>());
87
Assert.NotNull(pipeline.
GetService
<FunctionInvokingChatClient>());
88
Assert.NotNull(pipeline.
GetService
<DistributedCachingChatClient>());
89
Assert.NotNull(pipeline.
GetService
<CachingChatClient>());
90
Assert.NotNull(pipeline.
GetService
<OpenTelemetryChatClient>());
92
Assert.Same(client, pipeline.
GetService
<ChatCompletionsClient>());
93
Assert.IsType<FunctionInvokingChatClient>(pipeline.
GetService
<IChatClient>());
Microsoft.Extensions.AI.Ollama.Tests (8)
OllamaChatClientTests.cs (8)
48
Assert.Same(client, client.
GetService
<OllamaChatClient>());
49
Assert.Same(client, client.
GetService
<IChatClient>());
58
Assert.NotNull(pipeline.
GetService
<FunctionInvokingChatClient>());
59
Assert.NotNull(pipeline.
GetService
<DistributedCachingChatClient>());
60
Assert.NotNull(pipeline.
GetService
<CachingChatClient>());
61
Assert.NotNull(pipeline.
GetService
<OpenTelemetryChatClient>());
63
Assert.Same(client, pipeline.
GetService
<OllamaChatClient>());
64
Assert.IsType<FunctionInvokingChatClient>(pipeline.
GetService
<IChatClient>());
Microsoft.Extensions.AI.OpenAI.Tests (18)
OpenAIChatClientTests.cs (18)
91
Assert.Same(chatClient, chatClient.
GetService
<IChatClient>());
92
Assert.Same(chatClient, chatClient.
GetService
<OpenAIChatClient>());
94
Assert.Same(openAIClient, chatClient.
GetService
<OpenAIClient>());
96
Assert.NotNull(chatClient.
GetService
<ChatClient>());
105
Assert.NotNull(pipeline.
GetService
<FunctionInvokingChatClient>());
106
Assert.NotNull(pipeline.
GetService
<DistributedCachingChatClient>());
107
Assert.NotNull(pipeline.
GetService
<CachingChatClient>());
108
Assert.NotNull(pipeline.
GetService
<OpenTelemetryChatClient>());
110
Assert.Same(openAIClient, pipeline.
GetService
<OpenAIClient>());
111
Assert.IsType<FunctionInvokingChatClient>(pipeline.
GetService
<IChatClient>());
120
Assert.Same(chatClient, chatClient.
GetService
<IChatClient>());
121
Assert.Same(openAIClient, chatClient.
GetService
<ChatClient>());
130
Assert.NotNull(pipeline.
GetService
<FunctionInvokingChatClient>());
131
Assert.NotNull(pipeline.
GetService
<DistributedCachingChatClient>());
132
Assert.NotNull(pipeline.
GetService
<CachingChatClient>());
133
Assert.NotNull(pipeline.
GetService
<OpenTelemetryChatClient>());
135
Assert.Same(openAIClient, pipeline.
GetService
<ChatClient>());
136
Assert.IsType<FunctionInvokingChatClient>(pipeline.
GetService
<IChatClient>());