Skip to main content
Generates an embedding for one input using an embedding Provider. A VARCHAR input embeds the supplied text. A FILE input embeds its media content.

Syntax

Arguments

  • input: A VARCHAR expression for text or a FILE expression for one image or video. See FILE input support.
  • options: An optional constant JSON object. To override the Provider’s dimensions setting with the native dashscope protocol, use dimension, for example json_object('dimension', 512). With the openai protocol (including Model Studio’s OpenAI-compatible endpoint), use dimensions. The model and service must support the requested dimension.
For the types and default behavior of provider and model, see Common calling rules.

Return value

Returns a nullable ARRAY<FLOAT>. The service response must include a nonempty vector at index 0. Every element must be a finite FLOAT value. The database treats an invalid response as a row-level error.

Examples

Both calls use the vision_embedding Provider. Pass url directly to embed the URL string (url_text_embedding), or wrap it in a FILE with to_file to embed the image at that URL (image_embedding).