8 references to AsEmbeddingGenerator
Aspire.OpenAI (1)
AspireOpenAIClientBuilderEmbeddingGeneratorExtensions.cs (1)
57
var result = openAiClient.
AsEmbeddingGenerator
(deploymentName);
Microsoft.Extensions.AI.OpenAI.Tests (7)
OpenAIEmbeddingGeneratorIntegrationTests.cs (1)
12
?.
AsEmbeddingGenerator
(Environment.GetEnvironmentVariable("OPENAI_EMBEDDING_MODEL") ?? "text-embedding-3-small");
OpenAIEmbeddingGeneratorTests.cs (6)
37
Assert.Throws<ArgumentNullException>("openAIClient", () => ((OpenAIClient)null!).
AsEmbeddingGenerator
("model"));
41
Assert.Throws<ArgumentNullException>("modelId", () => client.
AsEmbeddingGenerator
(null!));
42
Assert.Throws<ArgumentException>("modelId", () => client.
AsEmbeddingGenerator
(" "));
57
IEmbeddingGenerator<string, Embedding<float>> embeddingGenerator = client.
AsEmbeddingGenerator
(model);
72
IEmbeddingGenerator<string, Embedding<float>> embeddingGenerator = openAIClient.
AsEmbeddingGenerator
("model");
153
}).
AsEmbeddingGenerator
("text-embedding-3-small");