diff --git a/src/backend/base/langflow/components/inputs/FileInput.py b/src/backend/base/langflow/components/inputs/FileInput.py deleted file mode 100644 index 0cd7c12b1..000000000 --- a/src/backend/base/langflow/components/inputs/FileInput.py +++ /dev/null @@ -1,48 +0,0 @@ -from pathlib import Path -from typing import Any, Dict - -from langflow.base.data.utils import TEXT_FILE_TYPES, parse_text_file_to_record -from langflow.interface.custom.custom_component import CustomComponent -from langflow.schema import Record - - -class FileInput(CustomComponent): - display_name = "File Input" - description = "A generic file input." - icon = "file-text" - - def build_config(self) -> Dict[str, Any]: - return { - "path": { - "display_name": "Path", - "field_type": "file", - "file_types": TEXT_FILE_TYPES, - "info": f"Supported file types: {', '.join(TEXT_FILE_TYPES)}", - }, - "silent_errors": { - "display_name": "Silent Errors", - "advanced": True, - "info": "If true, errors will not raise an exception.", - }, - } - - def load_file(self, path: str, silent_errors: bool = False) -> Record: - resolved_path = self.resolve_path(path) - path_obj = Path(resolved_path) - extension = path_obj.suffix[1:].lower() - if extension == "doc": - raise ValueError("doc files are not supported. Please save as .docx") - if extension not in TEXT_FILE_TYPES: - raise ValueError(f"Unsupported file type: {extension}") - record = parse_text_file_to_record(resolved_path, silent_errors) - self.status = record if record else "No data" - return record or Record() - - def build( - self, - path: str, - silent_errors: bool = False, - ) -> Record: - record = self.load_file(path, silent_errors) - self.status = record - return record diff --git a/src/backend/base/langflow/components/inputs/JsonInput.py b/src/backend/base/langflow/components/inputs/JsonInput.py deleted file mode 100644 index 713868147..000000000 --- a/src/backend/base/langflow/components/inputs/JsonInput.py +++ /dev/null @@ -1,17 +0,0 @@ -from langflow.base.io.text import TextComponent -from langflow.field_typing.constants import Data, NestedDict - -class JsonInput(TextComponent): - display_name = "JSON Input" - description = "JSON Input." - - def build_config(self): - return { - "input_value": { - "display_name": "JSON", - "field_type": "NestedDict" - } - } - - def build(self, input_value: NestedDict) -> NestedDict: - return input_value diff --git a/src/backend/base/langflow/components/inputs/KeyPairInput.py b/src/backend/base/langflow/components/inputs/KeyPairInput.py deleted file mode 100644 index c48d0a0e1..000000000 --- a/src/backend/base/langflow/components/inputs/KeyPairInput.py +++ /dev/null @@ -1,19 +0,0 @@ -from langflow.base.io.text import TextComponent -from langflow.field_typing.constants import Data - - -class KeyPairInput(TextComponent): - display_name = "Dictionary Input" - description = "Dictionary Input." - - def build_config(self): - return { - "input_value": { - "display_name": "Dictionaries", - "field_type": "dict", - "list": True - } - } - - def build(self, input_value: dict) -> dict: - return input_value diff --git a/src/backend/base/langflow/components/inputs/StringListInput.py b/src/backend/base/langflow/components/inputs/StringListInput.py deleted file mode 100644 index 5eadce9bc..000000000 --- a/src/backend/base/langflow/components/inputs/StringListInput.py +++ /dev/null @@ -1,13 +0,0 @@ -# from langflow.field_typing import Data -from langflow.schema import Record -from langflow.interface.custom.custom_component import CustomComponent - - -class StringListInput(CustomComponent): - display_name = "String List Input" - - def build_config(self): - return {"input_value": {"display_name": "String List Input", "field_type": "str", "list": True}} - - def build(self, input_value: list) -> Record: - return Record(data=input_value) diff --git a/src/backend/base/langflow/components/outputs/CSVOutput.py b/src/backend/base/langflow/components/outputs/CSVOutput.py deleted file mode 100644 index 711a6ab96..000000000 --- a/src/backend/base/langflow/components/outputs/CSVOutput.py +++ /dev/null @@ -1,17 +0,0 @@ -from typing import Optional - -from langflow.base.io.text import TextComponent -from langflow.field_typing import Text, Data - - -class CSVOutput(TextComponent): - display_name = "CSV Output" - description = "Used view csv files" - - field_config = { - "input_value": {"display_name": "csv","info":"A csv blob","input_types":["Data"]}, - "separator": {"display_name": "separator","info":"The separator used in the csv file","input_types":["Text"], "field_type":"Text","default_value":";","options":[";", ",", "|"]}, - } - - def build(self, input_value: Data, separator) -> Data: - return {"data": input_value, "separator": separator} diff --git a/src/backend/base/langflow/components/outputs/ImageOutput.py b/src/backend/base/langflow/components/outputs/ImageOutput.py deleted file mode 100644 index f50fb7bf7..000000000 --- a/src/backend/base/langflow/components/outputs/ImageOutput.py +++ /dev/null @@ -1,15 +0,0 @@ -from typing import Optional - -from langflow.base.io.text import TextComponent -from langflow.field_typing import Text - -class ImageOutput(TextComponent): - display_name = "Image Output" - description = "Used view image files" - - field_config = { - "input_value": {"display_name": "image","info":"A image url","input_types":["Text"]}, - } - - def build(self, input_value: Text) -> Text: - return input_value \ No newline at end of file diff --git a/src/backend/base/langflow/components/outputs/JsonOutput.py b/src/backend/base/langflow/components/outputs/JsonOutput.py deleted file mode 100644 index cbbc10ddc..000000000 --- a/src/backend/base/langflow/components/outputs/JsonOutput.py +++ /dev/null @@ -1,17 +0,0 @@ -from langflow.base.io.text import TextComponent -from langflow.field_typing.constants import Data, NestedDict - -class JsonOutput(TextComponent): - display_name = "JSON Output" - description = "JSON Output." - - def build_config(self): - return { - "input_value": { - "display_name": "JSON", - "field_type": "NestedDict" - } - } - - def build(self, input_value: NestedDict) -> NestedDict: - return input_value diff --git a/src/backend/base/langflow/components/outputs/KeyPairOutput.py b/src/backend/base/langflow/components/outputs/KeyPairOutput.py deleted file mode 100644 index f2204bb83..000000000 --- a/src/backend/base/langflow/components/outputs/KeyPairOutput.py +++ /dev/null @@ -1,19 +0,0 @@ -from langflow.base.io.text import TextComponent -from langflow.field_typing.constants import Data - - -class KeyPairOutput(TextComponent): - display_name = "Dictionary Output" - description = "Dictionary Output." - - def build_config(self): - return { - "input_value": { - "display_name": "Dictionaries", - "field_type": "dict", - "list": True - } - } - - def build(self, input_value: dict) -> dict: - return input_value diff --git a/src/backend/base/langflow/components/outputs/PDFOutput.py b/src/backend/base/langflow/components/outputs/PDFOutput.py deleted file mode 100644 index 75e1fabf4..000000000 --- a/src/backend/base/langflow/components/outputs/PDFOutput.py +++ /dev/null @@ -1,16 +0,0 @@ -from typing import Optional - -from langflow.base.io.text import TextComponent -from langflow.field_typing import Text - - -class PDFOutput(TextComponent): - display_name = "PDF Output" - description = "Used view pdf files" - - field_config = { - "input_value": {"display_name": "pdf","info":"A pdf url","input_types":["Text"]}, - } - - def build(self, input_value: Text) -> Text: - return input_value diff --git a/src/backend/base/langflow/components/outputs/StringListOutput.py b/src/backend/base/langflow/components/outputs/StringListOutput.py deleted file mode 100644 index 3b1ff6088..000000000 --- a/src/backend/base/langflow/components/outputs/StringListOutput.py +++ /dev/null @@ -1,13 +0,0 @@ -# from langflow.field_typing import Data -from langflow.schema import Record -from langflow.interface.custom.custom_component import CustomComponent - - -class StringListOutput(CustomComponent): - display_name = "String List Output" - - def build_config(self): - return {"input_value": {"display_name": "String List Output", "field_type": "str", "list": True}} - - def build(self, input_value: list) -> Record: - return Record(data=input_value) \ No newline at end of file