8 references to AsEmbeddingGenerator
Aspire.OpenAI (1)
AspireOpenAIClientBuilderEmbeddingGeneratorExtensions.cs (1)
57var 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)
37Assert.Throws<ArgumentNullException>("openAIClient", () => ((OpenAIClient)null!).AsEmbeddingGenerator("model")); 41Assert.Throws<ArgumentNullException>("modelId", () => client.AsEmbeddingGenerator(null!)); 42Assert.Throws<ArgumentException>("modelId", () => client.AsEmbeddingGenerator(" ")); 57IEmbeddingGenerator<string, Embedding<float>> embeddingGenerator = client.AsEmbeddingGenerator(model); 72IEmbeddingGenerator<string, Embedding<float>> embeddingGenerator = openAIClient.AsEmbeddingGenerator("model"); 153}).AsEmbeddingGenerator("text-embedding-3-small");