Skip to content

Embedding Generator Generate Async

This example assumes using VoyageAI; is in scope and apiKey contains your VoyageAI API key.

1
2
3
4
5
6
7
8
9
using var client = GetAuthorizedApi();
IEmbeddingGenerator<string, Embedding<float>> generator = client;

var embeddings = await generator.GenerateAsync(
    ["Hello, world!"],
    new EmbeddingGenerationOptions
    {
        ModelId = "voyage-3-lite",
    });