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