33 references to GetService
Aspire.Azure.AI.OpenAI.Tests (1)
AspireAzureOpenAIClientBuilderEmbeddingGeneratorExtensionsTests.cs (1)
190Assert.Equal(disableOpenTelemetry, generator.GetService<OpenTelemetryEmbeddingGenerator<string, Embedding<float>>>() is null);
Aspire.OpenAI.Tests (1)
AspireOpenAIClientBuilderEmbeddingGeneratorExtensionsTests.cs (1)
191Assert.Equal(disableOpenTelemetry, generator.GetService<OpenTelemetryEmbeddingGenerator<string, Embedding<float>>>() is null);
Microsoft.Extensions.AI.Abstractions.Tests (1)
Embeddings\EmbeddingGeneratorExtensionsTests.cs (1)
16Assert.Throws<ArgumentNullException>("generator", () => EmbeddingGeneratorExtensions.GetService<object>(null!));
Microsoft.Extensions.AI.AzureAIInference.Tests (7)
AzureAIInferenceEmbeddingGeneratorTests.cs (7)
63Assert.Same(embeddingGenerator, embeddingGenerator.GetService<IEmbeddingGenerator<string, Embedding<float>>>()); 64Assert.Same(client, embeddingGenerator.GetService<EmbeddingsClient>()); 72Assert.NotNull(pipeline.GetService<DistributedCachingEmbeddingGenerator<string, Embedding<float>>>()); 73Assert.NotNull(pipeline.GetService<CachingEmbeddingGenerator<string, Embedding<float>>>()); 74Assert.NotNull(pipeline.GetService<OpenTelemetryEmbeddingGenerator<string, Embedding<float>>>()); 76Assert.Same(client, pipeline.GetService<EmbeddingsClient>()); 77Assert.IsType<OpenTelemetryEmbeddingGenerator<string, Embedding<float>>>(pipeline.GetService<IEmbeddingGenerator<string, Embedding<float>>>());
Microsoft.Extensions.AI.Ollama.Tests (7)
OllamaEmbeddingGeneratorTests.cs (7)
29Assert.Same(generator, generator.GetService<OllamaEmbeddingGenerator>()); 30Assert.Same(generator, generator.GetService<IEmbeddingGenerator<string, Embedding<float>>>()); 38Assert.NotNull(pipeline.GetService<DistributedCachingEmbeddingGenerator<string, Embedding<float>>>()); 39Assert.NotNull(pipeline.GetService<CachingEmbeddingGenerator<string, Embedding<float>>>()); 40Assert.NotNull(pipeline.GetService<OpenTelemetryEmbeddingGenerator<string, Embedding<float>>>()); 42Assert.Same(generator, pipeline.GetService<OllamaEmbeddingGenerator>()); 43Assert.IsType<OpenTelemetryEmbeddingGenerator<string, Embedding<float>>>(pipeline.GetService<IEmbeddingGenerator<string, Embedding<float>>>());
Microsoft.Extensions.AI.OpenAI.Tests (16)
OpenAIEmbeddingGeneratorTests.cs (16)
74Assert.Same(embeddingGenerator, embeddingGenerator.GetService<IEmbeddingGenerator<string, Embedding<float>>>()); 75Assert.Same(embeddingGenerator, embeddingGenerator.GetService<OpenAIEmbeddingGenerator>()); 77Assert.Same(openAIClient, embeddingGenerator.GetService<OpenAIClient>()); 79Assert.NotNull(embeddingGenerator.GetService<EmbeddingClient>()); 87Assert.NotNull(pipeline.GetService<DistributedCachingEmbeddingGenerator<string, Embedding<float>>>()); 88Assert.NotNull(pipeline.GetService<CachingEmbeddingGenerator<string, Embedding<float>>>()); 89Assert.NotNull(pipeline.GetService<OpenTelemetryEmbeddingGenerator<string, Embedding<float>>>()); 91Assert.Same(openAIClient, pipeline.GetService<OpenAIClient>()); 92Assert.IsType<OpenTelemetryEmbeddingGenerator<string, Embedding<float>>>(pipeline.GetService<IEmbeddingGenerator<string, Embedding<float>>>()); 101Assert.Same(embeddingGenerator, embeddingGenerator.GetService<IEmbeddingGenerator<string, Embedding<float>>>()); 102Assert.Same(openAIClient, embeddingGenerator.GetService<EmbeddingClient>()); 110Assert.NotNull(pipeline.GetService<DistributedCachingEmbeddingGenerator<string, Embedding<float>>>()); 111Assert.NotNull(pipeline.GetService<CachingEmbeddingGenerator<string, Embedding<float>>>()); 112Assert.NotNull(pipeline.GetService<OpenTelemetryEmbeddingGenerator<string, Embedding<float>>>()); 114Assert.Same(openAIClient, pipeline.GetService<EmbeddingClient>()); 115Assert.IsType<OpenTelemetryEmbeddingGenerator<string, Embedding<float>>>(pipeline.GetService<IEmbeddingGenerator<string, Embedding<float>>>());