pyflink.dataframe.ai.llm.LLMAccessor.ai_embed#
- LLMAccessor.ai_embed(input_col: str | Expression, dimension: int = 1024, *, provider: str = None, model: str = None, config: Dict[str, str] = None) DataFrame[source]#
Generate embedding vectors for text.
- Parameters:
input_col – Column name (str) or Expression for the input text.
dimension – Dimension of the embedding vector (default 1024).
provider – Provider name.
model – Model name.
config – Optional runtime config.
- Returns:
embedding(ARRAY<FLOAT>): the embedding vector.
- Return type:
A new DataFrame with a column appended
Example:
>>> df.llm.ai_embed("text", 512, model="qwen-plus")