fix: Fix Text Splitters (#3783)
* fix: Fix Text Splitters * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
8c8be151e5
commit
f17de26ab0
1 changed files with 0 additions and 8 deletions
|
|
@ -4,15 +4,10 @@ from langchain_core.documents import BaseDocumentTransformer
|
|||
from langchain_text_splitters import TextSplitter
|
||||
|
||||
from langflow.base.document_transformers.model import LCDocumentTransformerComponent
|
||||
from langflow.io import Output
|
||||
from langflow.schema import Data
|
||||
|
||||
|
||||
class LCTextSplitterComponent(LCDocumentTransformerComponent):
|
||||
trace_type = "text_splitter"
|
||||
outputs = [
|
||||
Output(display_name="Data", name="data", method="split_data"),
|
||||
]
|
||||
|
||||
def _validate_outputs(self):
|
||||
required_output_methods = ["text_splitter"]
|
||||
|
|
@ -23,9 +18,6 @@ class LCTextSplitterComponent(LCDocumentTransformerComponent):
|
|||
elif not hasattr(self, method_name):
|
||||
raise ValueError(f"Method '{method_name}' must be defined.")
|
||||
|
||||
def split_data(self) -> list[Data]:
|
||||
return self.transform_data()
|
||||
|
||||
def build_document_transformer(self) -> BaseDocumentTransformer:
|
||||
return self.build_text_splitter()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue