Skip to main content
Ctrl+K
PyFlink 1.20+vvr.11.7.dev0 documentation - Home PyFlink 1.20+vvr.11.7.dev0 documentation - Home
  • API Reference
  • Examples
  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataStream
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • DataType
    • User Defined Functions
    • Configuration
    • GPU Support
    • AI / LLM
  • PyFlink Common
  • API Reference
  • PyFlink DataFrame
  • AI / LLM
  • pyflink.dataframe.ai.llm.LLMAccessor.ai_extract

pyflink.dataframe.ai.llm.LLMAccessor.ai_extract#

LLMAccessor.ai_extract(input_col: str | Expression, schema: str, *, provider: str = None, model: str = None, config: Dict[str, str] = None) → DataFrame[source]#

Extract structured information from text.

Parameters:
  • input_col – Column name (str) or Expression for the input text.

  • schema – JSON schema string describing the fields to extract, e.g. '{"name":"STRING", "phone":"STRING"}'.

  • provider – Provider name.

  • model – Model name.

  • config – Optional runtime config.

Returns:

  • extracted_json (STRING): extracted fields as a JSON string.

Return type:

A new DataFrame with a column appended

Example:

>>> df.llm.ai_extract("text",
...     '{"name":"STRING", "phone":"STRING"}', model="qwen-plus")

previous

pyflink.dataframe.ai.llm.LLMAccessor.ai_sentiment

next

pyflink.dataframe.ai.llm.LLMAccessor.ai_translate

On this page
  • LLMAccessor.ai_extract()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.