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