Skip to main content

Texte vers Embeddings

Converts text to a numeric embedding vector. Useful for vector storage or similarity comparison.

Parameters

ParameterTypeRequiredVariableDescription
inputArraydynamic valueYesYesArray of items containing the text to embed.
textFieldtextYesNoName of the field containing text in each array item.
model.providerchoice (openai, cohere, ollama, local)NoNoEmbedding model provider. (Default: "openai")
model.modeltextNoNoEmbedding model identifier to use. (Default: "text-embedding-3-small")
batchSizenumberNoNoNumber of items processed per batch for embedding. (Default: 50, min 1, max 2048)
dimensionsnumberNoNoGenerated vector size (depends on model, e.g. 1536 for OpenAI). (min 64, max 4096)
outputFieldtextNoNoField name where the vector will be stored in each item. (Default: "embedding")
outputVariabletextNoNoOutput variable name containing items with their vectors.

Parameters marked Variable = Yes accept the {{blockName.field}} syntax.

Output

Output variable : embeddingsResult

{
"success": false,
"results": "...",
"totalItems": 0,
"embeddedItems": 0,
"dimension": 0,
"provider": "...",
"durationMs": 0
}

Example

Generate an embedding for a text.

Input :

{"text": "intelligence artificielle"}

Output :

{"embedding": [0.012, -0.034, ...], "dimensions": 1536}
Tip

The returned vector has the embedding model dimension (1536 by default). Combine with a vector storage block to index your data.