Skip to content

Embedding Generator Single Text

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

1
2
3
4
5
6
7
8
9
using var client = new JinaClient(apiKey);

IEmbeddingGenerator<string, Embedding<float>> generator = client;
var embeddings = await generator.GenerateAsync(
    ["Hello, world!"],
    new EmbeddingGenerationOptions
    {
        ModelId = "jina-embeddings-v3",
    });