From 0baba4c2d5d0da69eeedac4cadff0d1e2f987373 Mon Sep 17 00:00:00 2001
From: Deon Sanchez <69873175+deon-sanchez@users.noreply.github.com>
Date: Tue, 30 Sep 2025 16:00:40 -0600
Subject: [PATCH] fix: Rename Component- Smart Function into Smart Transform
(#10003)
* changes smart function to transform
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
---
docs/docs/Components/bundles-aiml.mdx | 2 +-
docs/docs/Components/bundles-amazon.mdx | 2 +-
docs/docs/Components/bundles-anthropic.mdx | 2 +-
docs/docs/Components/bundles-azure.mdx | 2 +-
docs/docs/Components/bundles-baidu.mdx | 2 +-
docs/docs/Components/bundles-cohere.mdx | 2 +-
docs/docs/Components/bundles-deepseek.mdx | 2 +-
docs/docs/Components/bundles-groq.mdx | 2 +-
docs/docs/Components/bundles-huggingface.mdx | 2 +-
docs/docs/Components/bundles-ibm.mdx | 2 +-
docs/docs/Components/bundles-lmstudio.mdx | 2 +-
docs/docs/Components/bundles-maritalk.mdx | 2 +-
docs/docs/Components/bundles-mistralai.mdx | 2 +-
docs/docs/Components/bundles-novita.mdx | 2 +-
docs/docs/Components/bundles-ollama.mdx | 2 +-
docs/docs/Components/bundles-openai.mdx | 2 +-
docs/docs/Components/bundles-openrouter.mdx | 2 +-
docs/docs/Components/bundles-perplexity.mdx | 2 +-
docs/docs/Components/bundles-sambanova.mdx | 2 +-
docs/docs/Components/bundles-vertexai.mdx | 2 +-
docs/docs/Components/bundles-xai.mdx | 2 +-
docs/docs/Components/components-models.mdx | 6 +--
.../docs/Components/components-processing.mdx | 40 +++++++++----------
docs/docs/Develop/data-types.mdx | 2 +-
.../processing/test_parser_component.py | 12 ++++--
.../components/processing/lambda_filter.py | 6 +--
26 files changed, 57 insertions(+), 51 deletions(-)
diff --git a/docs/docs/Components/bundles-aiml.mdx b/docs/docs/Components/bundles-aiml.mdx
index ec2815347b..d4da5126b1 100644
--- a/docs/docs/Components/bundles-aiml.mdx
+++ b/docs/docs/Components/bundles-aiml.mdx
@@ -13,7 +13,7 @@ This page describes the components that are available in the **AI/ML** bundle.
## AI/ML API text generation
This component creates a `ChatOpenAI` model instance using the AI/ML API.
-The output is exclusively a **Language Model** ([`LanguageModel`](/data-types#languagemodel)) that you can connect to another LLM-driven component, such as a **Smart Function** component.
+The output is exclusively a **Language Model** ([`LanguageModel`](/data-types#languagemodel)) that you can connect to another LLM-driven component, such as a **Smart Transform** component.
For more information, see the [AI/ML API Langflow integration documentation](https://docs.aimlapi.com/integrations/langflow) and [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-amazon.mdx b/docs/docs/Components/bundles-amazon.mdx
index 662d155f8e..11f13feb14 100644
--- a/docs/docs/Components/bundles-amazon.mdx
+++ b/docs/docs/Components/bundles-amazon.mdx
@@ -17,7 +17,7 @@ This component generates text using [Amazon Bedrock LLMs](https://docs.aws.amazo
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
Specifically, the **Language Model** output is an instance of [`ChatBedrock`](https://python.langchain.com/docs/integrations/chat/bedrock/) configured according to the component's parameters.
-Use the **Language Model** output when you want to use an Amazon Bedrock model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use an Amazon Bedrock model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-anthropic.mdx b/docs/docs/Components/bundles-anthropic.mdx
index fa97a1d1f1..0898aac8f6 100644
--- a/docs/docs/Components/bundles-anthropic.mdx
+++ b/docs/docs/Components/bundles-anthropic.mdx
@@ -19,7 +19,7 @@ The **Anthropic** component generates text using Anthropic Chat and Language mod
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
Specifically, the **Language Model** output is an instance of [`ChatAnthropic`](https://python.langchain.com/docs/integrations/chat/anthropic/) configured according to the component's parameters.
-Use the **Language Model** output when you want to use an Anthropic model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use an Anthropic model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-azure.mdx b/docs/docs/Components/bundles-azure.mdx
index 7f4aedc7e4..f5748bad19 100644
--- a/docs/docs/Components/bundles-azure.mdx
+++ b/docs/docs/Components/bundles-azure.mdx
@@ -17,7 +17,7 @@ This component generates text using [Azure OpenAI LLMs](https://learn.microsoft.
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
Specifically, the **Language Model** output is an instance of [`AzureChatOpenAI`](https://python.langchain.com/docs/integrations/chat/azure_chat_openai/) configured according to the component's parameters.
-Use the **Language Model** output when you want to use an Azure OpenAI model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use an Azure OpenAI model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-baidu.mdx b/docs/docs/Components/bundles-baidu.mdx
index 9bffcc6a8d..3dbffb2068 100644
--- a/docs/docs/Components/bundles-baidu.mdx
+++ b/docs/docs/Components/bundles-baidu.mdx
@@ -15,6 +15,6 @@ The **Qianfan** component generates text using Qianfan's language models.
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use a Qianfan model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use a Qianfan model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models) and the [Qianfan documentation](https://github.com/baidubce/bce-qianfan-sdk).
\ No newline at end of file
diff --git a/docs/docs/Components/bundles-cohere.mdx b/docs/docs/Components/bundles-cohere.mdx
index b01ee8248f..13f5cff220 100644
--- a/docs/docs/Components/bundles-cohere.mdx
+++ b/docs/docs/Components/bundles-cohere.mdx
@@ -18,7 +18,7 @@ This component generates text using Cohere's language models.
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use a Cohere model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use a Cohere model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-deepseek.mdx b/docs/docs/Components/bundles-deepseek.mdx
index 6922d4a0c9..73d9fd33c2 100644
--- a/docs/docs/Components/bundles-deepseek.mdx
+++ b/docs/docs/Components/bundles-deepseek.mdx
@@ -18,7 +18,7 @@ The **DeepSeek** component generates text using DeepSeek's language models.
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use a DeepSeek model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use a DeepSeek model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-groq.mdx b/docs/docs/Components/bundles-groq.mdx
index b26b366512..e5cf18a412 100644
--- a/docs/docs/Components/bundles-groq.mdx
+++ b/docs/docs/Components/bundles-groq.mdx
@@ -18,7 +18,7 @@ This component generates text using Groq's language models.
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
Specifically, the **Language Model** output is an instance of [`ChatGroq`](https://python.langchain.com/docs/integrations/chat/groq/) configured according to the component's parameters.
-Use the **Language Model** output when you want to use a Groq model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use a Groq model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-huggingface.mdx b/docs/docs/Components/bundles-huggingface.mdx
index 755e0beb46..dd33a1118c 100644
--- a/docs/docs/Components/bundles-huggingface.mdx
+++ b/docs/docs/Components/bundles-huggingface.mdx
@@ -20,7 +20,7 @@ Authentication is required.
This component can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
Specifically, the **Language Model** output is an instance of [`HuggingFaceHub`](https://python.langchain.com/docs/integrations/providers/huggingface/) configured according to the component's parameters.
-Use the **Language Model** output when you want to use a Hugging Face model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use a Hugging Face model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-ibm.mdx b/docs/docs/Components/bundles-ibm.mdx
index 9858c67de2..fa5d12e2fe 100644
--- a/docs/docs/Components/bundles-ibm.mdx
+++ b/docs/docs/Components/bundles-ibm.mdx
@@ -45,7 +45,7 @@ You can use the **IBM watsonx.ai** component anywhere you need a language model
The **IBM watsonx.ai** component can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use an IBM watsonx.ai model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use an IBM watsonx.ai model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
The `LanguageModel` output from the **IBM watsonx.ai** component is an instance of [ChatWatsonx](https://python.langchain.com/docs/integrations/chat/ibm_watsonx/) configured according to the [component's parameters](#ibm-watsonxai-parameters).
diff --git a/docs/docs/Components/bundles-lmstudio.mdx b/docs/docs/Components/bundles-lmstudio.mdx
index a027f4be5f..0e5fe18c99 100644
--- a/docs/docs/Components/bundles-lmstudio.mdx
+++ b/docs/docs/Components/bundles-lmstudio.mdx
@@ -17,7 +17,7 @@ The **LM Studio** component generates text using LM Studio's local language mode
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use an LM Studio model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use an LM Studio model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-maritalk.mdx b/docs/docs/Components/bundles-maritalk.mdx
index f4d60ec4cb..e01499dc19 100644
--- a/docs/docs/Components/bundles-maritalk.mdx
+++ b/docs/docs/Components/bundles-maritalk.mdx
@@ -18,7 +18,7 @@ The **MariTalk** component generates text using MariTalk LLMs.
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use a MariTalk model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use a MariTalk model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-mistralai.mdx b/docs/docs/Components/bundles-mistralai.mdx
index b6fcd9365c..2a829649c9 100644
--- a/docs/docs/Components/bundles-mistralai.mdx
+++ b/docs/docs/Components/bundles-mistralai.mdx
@@ -18,7 +18,7 @@ The **MistralAI** component generates text using MistralAI LLMs.
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use a MistralAI model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use a MistralAI model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-novita.mdx b/docs/docs/Components/bundles-novita.mdx
index fcd43a4087..8ffe5e79e4 100644
--- a/docs/docs/Components/bundles-novita.mdx
+++ b/docs/docs/Components/bundles-novita.mdx
@@ -16,7 +16,7 @@ This component generates text using [Novita's language models](https://novita.ai
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use a Novita model as the LLM for another LLM-driven component, such as a **Language Model** or **Smart Function** component.
+Use the **Language Model** output when you want to use a Novita model as the LLM for another LLM-driven component, such as a **Language Model** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-ollama.mdx b/docs/docs/Components/bundles-ollama.mdx
index 65c016b576..8ffff1fa03 100644
--- a/docs/docs/Components/bundles-ollama.mdx
+++ b/docs/docs/Components/bundles-ollama.mdx
@@ -32,7 +32,7 @@ To use the **Ollama** component in a flow, connect Langflow to your locally runn
5. Connect the **Ollama** component to other components in the flow, depending on how you want to use the model.
- Language model components can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)). Use the **Language Model** output when you want to use an Ollama model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component. For more information, see [Language model components](/components-models).
+ Language model components can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)). Use the **Language Model** output when you want to use an Ollama model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component. For more information, see [Language model components](/components-models).
In the following example, the flow uses `LanguageModel` output to use an Ollama model as the LLM for an [**Agent** component](/components-agents).
diff --git a/docs/docs/Components/bundles-openai.mdx b/docs/docs/Components/bundles-openai.mdx
index 6e98e92df8..bbf735bb8f 100644
--- a/docs/docs/Components/bundles-openai.mdx
+++ b/docs/docs/Components/bundles-openai.mdx
@@ -20,7 +20,7 @@ It provides access to the same OpenAI models that are available in the core **La
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use a specific OpenAI model configuration as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use a specific OpenAI model configuration as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-openrouter.mdx b/docs/docs/Components/bundles-openrouter.mdx
index e35c1c5278..ae67e0d0d1 100644
--- a/docs/docs/Components/bundles-openrouter.mdx
+++ b/docs/docs/Components/bundles-openrouter.mdx
@@ -18,7 +18,7 @@ This component generates text using OpenRouter's unified API for multiple AI mod
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use an OpenRouter model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use an OpenRouter model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-perplexity.mdx b/docs/docs/Components/bundles-perplexity.mdx
index c46fd1230f..309c02d35e 100644
--- a/docs/docs/Components/bundles-perplexity.mdx
+++ b/docs/docs/Components/bundles-perplexity.mdx
@@ -18,7 +18,7 @@ This component generates text using Perplexity's language models.
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use a Perplexity model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use a Perplexity model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-sambanova.mdx b/docs/docs/Components/bundles-sambanova.mdx
index 3bfc695e07..37baeaca6b 100644
--- a/docs/docs/Components/bundles-sambanova.mdx
+++ b/docs/docs/Components/bundles-sambanova.mdx
@@ -18,7 +18,7 @@ This component generates text using SambaNova LLMs.
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use a SambaNova model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use a SambaNova model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-vertexai.mdx b/docs/docs/Components/bundles-vertexai.mdx
index deda5a04ea..70cd4430aa 100644
--- a/docs/docs/Components/bundles-vertexai.mdx
+++ b/docs/docs/Components/bundles-vertexai.mdx
@@ -20,7 +20,7 @@ The **Vertex AI** component generates text using Google Vertex AI models.
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use a Vertex AI model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use a Vertex AI model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/bundles-xai.mdx b/docs/docs/Components/bundles-xai.mdx
index 896db788a0..01bc99026a 100644
--- a/docs/docs/Components/bundles-xai.mdx
+++ b/docs/docs/Components/bundles-xai.mdx
@@ -18,7 +18,7 @@ The **xAI** component generates text using xAI models like [Grok](https://x.ai/g
It can output either a **Model Response** ([`Message`](/data-types#message)) or a **Language Model** ([`LanguageModel`](/data-types#languagemodel)).
-Use the **Language Model** output when you want to use an xAI model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Function** component.
+Use the **Language Model** output when you want to use an xAI model as the LLM for another LLM-driven component, such as an **Agent** or **Smart Transform** component.
For more information, see [Language model components](/components-models).
diff --git a/docs/docs/Components/components-models.mdx b/docs/docs/Components/components-models.mdx
index cd5e83c2d9..4107dd597a 100644
--- a/docs/docs/Components/components-models.mdx
+++ b/docs/docs/Components/components-models.mdx
@@ -95,7 +95,7 @@ For example, if you are using the **Language Model** core component, you could t
Some components use a language model component to perform LLM-driven actions.
Typically, these components prepare data for further processing by downstream components, rather than emitting direct chat output.
-For an example, see the [**Smart Function** component](/components-processing#smart-function).
+For an example, see the [**Smart Transform** component](/components-processing#smart-transform).
A component must accept a `LanguageModel` input to use a language model component as a driver, and you must set the language model component's output type to `LanguageModel`.
For more information, see [Language Model output types](#language-model-output-types).
@@ -155,10 +155,10 @@ Language model components, including the core component and bundled components,
* **Model Response**: The default output type emits the model's generated response as [`Message` data](/data-types#message).
Use this output type when you want the typical LLM interaction where the LLM produces a text response based on given input.
-* **Language Model**: Change the language model component's output type to [`LanguageModel`](/data-types#languagemodel) when you need to attach an LLM to another component in your flow, such as an **Agent** or **Smart Function** component.
+* **Language Model**: Change the language model component's output type to [`LanguageModel`](/data-types#languagemodel) when you need to attach an LLM to another component in your flow, such as an **Agent** or **Smart Transform** component.
With this configuration, the language model component supports an action completed by another component, rather than a direct chat interaction.
- For an example, the **Smart Function** component uses an LLM to create a function from natural language input.
+ For an example, the **Smart Transform** component uses an LLM to create a function from natural language input.
## Additional language models
diff --git a/docs/docs/Components/components-processing.mdx b/docs/docs/Components/components-processing.mdx
index f770430b88..0a8803ad00 100644
--- a/docs/docs/Components/components-processing.mdx
+++ b/docs/docs/Components/components-processing.mdx
@@ -14,7 +14,7 @@ They have many uses, including:
* Feed instructions and context to your LLMs and agents with the [**Prompt Template** component](#prompt-template).
* Extract content from larger chunks of data with a [**Parser** component](#parser).
-* Filter data with natural language with the [**Smart Function** component](#smart-function).
+* Filter data with natural language with the [**Smart Transform** component](#smart-transform).
* Save data to your local machine with the [**Save File** component](#save-file).
* Transform data into a different data type with the [**Type Convert** component](#type-convert) to pass it between incompatible components.
@@ -100,7 +100,7 @@ For this example, select the **Select Keys** operation.
:::tip
You can select only one operation.
If you need to perform multiple operations on the data, you can chain multiple **Data Operations** components together to execute each operation in sequence.
- For more complex multi-step operations, consider using a component like the **Smart Function** component.
+ For more complex multi-step operations, consider using a component like the **Smart Transform** component.
:::
3. Under **Select Keys**, add keys for `name`, `username`, and `email`.
@@ -203,7 +203,7 @@ The only requirement is that the preceding component must create `DataFrame` out
The sixth component, **Chat Output**, is optional in this example.
It only serves as a convenient way for you to view the final output in the **Playground**, rather than inspecting the component logs.
- 
+ 
If you want to use this example to test the **DataFrame Operations** component, do the following:
@@ -211,19 +211,19 @@ The only requirement is that the preceding component must create `DataFrame` out
* **API Request**
* **Language Model**
- * **Smart Function**
+ * **Smart Transform**
* **Type Convert**
- 2. Configure the [**Smart Function** component](#smart-function) and its dependencies:
+ 2. Configure the [**Smart Transform** component](#smart-transform) and its dependencies:
- * **API Request**: Configure the [**API Request** component](/components-data#api-request) to get JSON data from an endpoint of your choice, and then connect the **API Response** output to the **Smart Function** component's **Data** input.
+ * **API Request**: Configure the [**API Request** component](/components-data#api-request) to get JSON data from an endpoint of your choice, and then connect the **API Response** output to the **Smart Transform** component's **Data** input.
* **Language Model**: Select your preferred provider and model, and then enter a valid API key.
- Change the output to **Language Model**, and then connect the `LanguageModel` output to the **Smart Function** component's **Language Model** input.
- * **Smart Function**: In the **Instructions** field, enter natural language instructions to extract data from the API response.
+ Change the output to **Language Model**, and then connect the `LanguageModel` output to the **Smart Transform** component's **Language Model** input.
+ * **Smart Transform**: In the **Instructions** field, enter natural language instructions to extract data from the API response.
Your instructions depend on the response content and desired outcome.
For example, if the response contains a large `result` field, you might provide instructions like `explode the result field out into a Data object`.
- 3. Convert the **Smart Function** component's `Data` output to `DataFrame`:
+ 3. Convert the **Smart Transform** component's `Data` output to `DataFrame`:
1. Connect the **Filtered Data** output to the **Type Convert** component's **Data** input.
2. Set the **Type Convert** component's **Output Type** to **DataFrame**.
@@ -246,13 +246,13 @@ For example, the **Filter** operation filters the rows based on a specified colu
:::tip
You can select only one operation.
If you need to perform multiple operations on the data, you can chain multiple **DataFrame Operations** components together to execute each operation in sequence.
- For more complex multi-step operations, like dramatic schema changes or pivots, consider using an LLM-powered component, like the **Structured Output** or **Smart Function** component, as a replacement or preparation for the **DataFrame Operations** component.
+ For more complex multi-step operations, like dramatic schema changes or pivots, consider using an LLM-powered component, like the **Structured Output** or **Smart Transform** component, as a replacement or preparation for the **DataFrame Operations** component.
:::
- If you're following along with the example flow, select any operation that you want to apply to the data that was extracted by the **Smart Function** component.
+ If you're following along with the example flow, select any operation that you want to apply to the data that was extracted by the **Smart Transform** component.
To view the contents of the incoming `DataFrame`, click **Run component** on the **Type Convert** component, and then **Inspect output**.
If the `DataFrame` seems malformed, click **Inspect output** on each upstream component to determine where the error occurs, and then modify your flow's configuration as needed.
- For example, if the **Smart Function** component didn't extract the expected fields, modify your instructions or verify that the given fields are present in the **API Response** output.
+ For example, if the **Smart Transform** component didn't extract the expected fields, modify your instructions or verify that the given fields are present in the **API Response** output.
4. Configure the operation's parameters.
The specific parameters depend on the selected operation.
@@ -550,7 +550,7 @@ There are several ways you can address these inconsistencies:
* Rectify the source data directly.
* Use other components to amend or filter anomalies before passing the data to the **Parser** component.
- There are many components you can use for this depending on your goal, such as the **Data Operations**, **Structured Output**, and **Smart Function** components.
+ There are many components you can use for this depending on your goal, such as the **Data Operations**, **Structured Output**, and **Smart Transform** components.
* Enable the **Parser** component's **Clean Data** parameter to skip empty rows or lines.
## Python Interpreter
@@ -696,11 +696,11 @@ To configure the **Save File** component and use it in a flow, do the following:
5. Optional: If you want to use the saved file in a flow, you must use an API call or another component to retrieve the file from the given filepath.
-## Smart Function
+## Smart Transform
-In Langflow version 1.5, this component was renamed from **Lambda Filter** to **Smart Function**.
+In Langflow version 1.5, this component was renamed from **Lambda Filter** to **Smart Transform**.
-The **Smart Function** component uses an LLM to generate a Lambda function to filter or transform structured data based on natural language instructions.
+The **Smart Transform** component uses an LLM to generate a Lambda function to filter or transform structured data based on natural language instructions.
You must connect this component to a [language model component](/components-models), which is used to generate a function based on the natural language instructions you provide in the **Instructions** parameter.
The LLM runs the function against the data input, and then outputs the results as [`Data`](/data-types#data).
@@ -711,13 +711,13 @@ One sentence or less is preferred because end punctuation, like periods, can cau
If you need to provide more details instructions that aren't directly relevant to the Lambda function, you can input them in the **Language Model** component's **Input** field or through a **Prompt Template** component.
:::
-The following example uses the **API Request** endpoint to pass JSON data from the `https://jsonplaceholder.typicode.com/users` endpoint to the **Smart Function** component.
-Then, the **Smart Function** component passes the data and the instruction `extract emails` to the attached **Language Model** component.
+The following example uses the **API Request** endpoint to pass JSON data from the `https://jsonplaceholder.typicode.com/users` endpoint to the **Smart Transform** component.
+Then, the **Smart Transform** component passes the data and the instruction `extract emails` to the attached **Language Model** component.
From there, the LLM generates a filter function that extracts email addresses from the JSON data, returning the filtered data as chat output.
-
+
-### Smart Function parameters
+### Smart Transform parameters
diff --git a/docs/docs/Develop/data-types.mdx b/docs/docs/Develop/data-types.mdx
index 989fdf9444..ee29d273f7 100644
--- a/docs/docs/Develop/data-types.mdx
+++ b/docs/docs/Develop/data-types.mdx
@@ -140,7 +140,7 @@ For information about the underlying Python classes that produce `Embeddings`, s
The `LanguageModel` type is a specific data type that can be produced by language model components and accepted by components that use an LLM.
When you change a language model component's output type from **Model Response** to **Language Model**, the component's output port changes from a **Message** port to a **Language Model** port .
-Then, you connect the outgoing **Language Model** port to a **Language Model** input port on a compatible component, such as a **Smart Function** component.
+Then, you connect the outgoing **Language Model** port to a **Language Model** input port on a compatible component, such as a **Smart Transform** component.
For more information about using these components in flows and toggling `LanguageModel` output, see [Language model components](/components-models#language-model-output-types).
diff --git a/src/backend/tests/unit/components/processing/test_parser_component.py b/src/backend/tests/unit/components/processing/test_parser_component.py
index b5ac86252d..98926d525d 100644
--- a/src/backend/tests/unit/components/processing/test_parser_component.py
+++ b/src/backend/tests/unit/components/processing/test_parser_component.py
@@ -117,7 +117,11 @@ class TestParserComponent(ComponentTestBaseWithoutClient):
def test_clean_data_with_stringify(self, component_class):
# Arrange
data_frame = DataFrame(
- {"Name": ["John", "Jane\n", "\nBob"], "Age": [30, None, 25], "Notes": ["Good\n\nPerson", "", "Nice\n"]}
+ {
+ "Name": ["John", "Jane\n", "\nBob"],
+ "Age": [30, None, 25],
+ "Notes": ["Good\n\nPerson", "", "Nice\n"],
+ }
)
kwargs = {
"input_data": data_frame,
@@ -159,7 +163,8 @@ class TestParserComponent(ComponentTestBaseWithoutClient):
# Act & Assert
with pytest.raises(
- ValueError, match=re.escape("Unsupported input type: . Expected DataFrame or Data.")
+ ValueError,
+ match=re.escape("Unsupported input type: . Expected DataFrame or Data."),
):
component.parse_combined_text()
@@ -174,7 +179,8 @@ class TestParserComponent(ComponentTestBaseWithoutClient):
# Act & Assert
with pytest.raises(
- ValueError, match=re.escape("Unsupported input type: . Expected DataFrame or Data.")
+ ValueError,
+ match=re.escape("Unsupported input type: . Expected DataFrame or Data."),
):
component.parse_combined_text()
diff --git a/src/lfx/src/lfx/components/processing/lambda_filter.py b/src/lfx/src/lfx/components/processing/lambda_filter.py
index 11c86cf378..3bb3197929 100644
--- a/src/lfx/src/lfx/components/processing/lambda_filter.py
+++ b/src/lfx/src/lfx/components/processing/lambda_filter.py
@@ -14,11 +14,11 @@ if TYPE_CHECKING:
class LambdaFilterComponent(Component):
- display_name = "Smart Function"
+ display_name = "Smart Transform"
description = "Uses an LLM to generate a function for filtering or transforming structured data."
- documentation: str = "https://docs.langflow.org/components-processing#smart-function"
+ documentation: str = "https://docs.langflow.org/components-processing#smart-transform"
icon = "square-function"
- name = "Smart Function"
+ name = "Smart Transform"
inputs = [
DataInput(