7 implementations of GetService
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\DelegatingChatClient.cs (1)
66public virtual TService? GetService<TService>(object? key = null)
Microsoft.Extensions.AI.Abstractions.Tests (1)
TestChatClient.cs (1)
29public TService? GetService<TService>(object? key = null)
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
61public TService? GetService<TService>(object? key = null)
Microsoft.Extensions.AI.Integration.Tests (1)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestChatClient.cs (1)
29public TService? GetService<TService>(object? key = null)
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
153public TService? GetService<TService>(object? key = null)
Microsoft.Extensions.AI.OpenAI (1)
OpenAIChatClient.cs (1)
86public TService? GetService<TService>(object? key = null)
Microsoft.Extensions.AI.Tests (1)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestChatClient.cs (1)
29public TService? GetService<TService>(object? key = null)
34 references to GetService
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\DelegatingChatClient.cs (1)
71return key is null && this is TService service ? service : InnerClient.GetService<TService>(key);
Microsoft.Extensions.AI.AzureAIInference.Tests (9)
AzureAIInferenceChatClientTests.cs (9)
61Assert.Same(chatClient, chatClient.GetService<IChatClient>()); 62Assert.Same(chatClient, chatClient.GetService<AzureAIInferenceChatClient>()); 64Assert.Same(client, chatClient.GetService<ChatCompletionsClient>()); 72Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 73Assert.NotNull(pipeline.GetService<DistributedCachingChatClient>()); 74Assert.NotNull(pipeline.GetService<CachingChatClient>()); 75Assert.NotNull(pipeline.GetService<OpenTelemetryChatClient>()); 77Assert.Same(client, pipeline.GetService<ChatCompletionsClient>()); 78Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<IChatClient>());
Microsoft.Extensions.AI.Ollama.Tests (6)
OllamaChatClientTests.cs (6)
43Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 44Assert.NotNull(pipeline.GetService<DistributedCachingChatClient>()); 45Assert.NotNull(pipeline.GetService<CachingChatClient>()); 46Assert.NotNull(pipeline.GetService<OpenTelemetryChatClient>()); 48Assert.Same(client, pipeline.GetService<OllamaChatClient>()); 49Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<IChatClient>());
Microsoft.Extensions.AI.OpenAI.Tests (18)
OpenAIChatClientTests.cs (18)
77Assert.Same(chatClient, chatClient.GetService<IChatClient>()); 78Assert.Same(chatClient, chatClient.GetService<OpenAIChatClient>()); 80Assert.Same(openAIClient, chatClient.GetService<OpenAIClient>()); 82Assert.NotNull(chatClient.GetService<ChatClient>()); 90Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 91Assert.NotNull(pipeline.GetService<DistributedCachingChatClient>()); 92Assert.NotNull(pipeline.GetService<CachingChatClient>()); 93Assert.NotNull(pipeline.GetService<OpenTelemetryChatClient>()); 95Assert.Same(openAIClient, pipeline.GetService<OpenAIClient>()); 96Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<IChatClient>()); 105Assert.Same(chatClient, chatClient.GetService<IChatClient>()); 106Assert.Same(openAIClient, chatClient.GetService<ChatClient>()); 114Assert.NotNull(pipeline.GetService<FunctionInvokingChatClient>()); 115Assert.NotNull(pipeline.GetService<DistributedCachingChatClient>()); 116Assert.NotNull(pipeline.GetService<CachingChatClient>()); 117Assert.NotNull(pipeline.GetService<OpenTelemetryChatClient>()); 119Assert.Same(openAIClient, pipeline.GetService<ChatClient>()); 120Assert.IsType<FunctionInvokingChatClient>(pipeline.GetService<IChatClient>());