.. ################################################################################ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ################################################################################ ======== AI / LLM ======== The AI module provides integration with large language models (LLMs) for tasks such as classification, sentiment analysis, text extraction, translation, summarization, PII masking, embedding generation, and vector search. Access these functions through the ``df.llm`` accessor on a DataFrame. Example:: >>> import pyflink.dataframe as pf >>> pf.set_model_provider(pf.OpenAICompatProvider( ... task="chat/completions", model="qwen3.6-plus")) >>> df = pf.from_dict({"text": ["Hello world", "Bonjour le monde"]}) >>> df.llm.ai_translate( ... "text", source_lang="auto", target_lang="en").collect() Model Providers --------------- Register and manage LLM providers. .. currentmodule:: pyflink.dataframe .. autosummary:: :toctree: api/ set_model_provider set_default_model_provider list_model_providers Model Provider -------------- Base class and built-in provider implementations. .. currentmodule:: pyflink.dataframe .. autosummary:: :toctree: api/ ModelProvider OpenAICompatProvider DashScopeProvider TritonProvider GenericProvider LLM Accessor ------------ Accessed via the ``df.llm`` property on a DataFrame. Provides methods for common AI tasks. .. currentmodule:: pyflink.dataframe.ai.llm .. autosummary:: :toctree: api/ LLMAccessor.vector_search LLMAccessor.predict LLMAccessor.ai_classify LLMAccessor.ai_sentiment LLMAccessor.ai_extract LLMAccessor.ai_translate LLMAccessor.ai_summarize LLMAccessor.ai_mask LLMAccessor.ai_embed