Skip to content

Text Embedding

Shows how to generate text embeddings using the MEAI IEmbeddingGenerator interface.

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

1
2
3
4
5
6
7
using var client = new TwelveLabsClient(apiKey);
client.WithApiKey(apiKey);

// Use the MEAI IEmbeddingGenerator interface for text embeddings.
IEmbeddingGenerator<string, Embedding<float>> generator = client;

var metadata = generator.GetService<EmbeddingGeneratorMetadata>();