llm_embedding function generates vector embeddings that represent the semantic meaning of text from specified table columns.
Modalities
Text
Supported. Pass one or more text columns incontext_columns.
Image
Not supported directly. Describe the image withllm_complete (type: 'image'), then embed the description.
Voice
Not supported on raw audio. Transcribe withllm_complete (type: 'audio'), then embed the transcript.
1. Simple Usage (without data)
1.1 Basic Embedding Generation
product_name and product_description columns using the text-embedding-3-small model. The output is a semantic vector that represents the content of the product’s name and description.
1.2 Similarity Search
0.8 are included.
2. Input Parameters
Thellm_embedding function accepts two primary inputs: model configuration and column mappings.
2.1 Model Configuration
- Parameter:
model_nameandsecret_name
2.1.1 Model Selection
- Description: Specifies the model used for text generation.
- Example:
2.1.2 Model Selection with Secret
- Description: Specifies the model along with the secret name to be used for authentication when accessing the model.
- Example:
2.2 Context Columns Configuration
- Parameter:
context_columnsarray - Description: Specifies the text columns from the table to be passed to the model for embedding generation. Each column can have two properties:
data: The SQL column data (required)name: Custom name for the column (optional)
- Note: Embeddings are text-only. For image or voice content, derive text first (see Modalities above).
- Example:
3. Output
The function returns a JSON array containing floating-point numbers that represent the semantic vector of the input text. Example Output:For a product with the description “Wireless headphones with noise cancellation”, the output might look like this:

