Discussion on SuperComponent
abstraction
#189
Replies: 4 comments 10 replies
-
Would it be possible to also provide a full code example (in the docs or cookbook)? As far as I understand it, it's a wrapper around single components. I would be particularly interested in knowing what the purpose of this |
Beta Was this translation helpful? Give feedback.
-
Hello @d-kleine here are two visualized pipelines, one with a MultiFileConverter component, which uses SuperComponent and one without. Currently, the MultiFileConverter hides all the complexity. |
Beta Was this translation helpful? Give feedback.
-
If you want to try out building with a SuperComponent, here is code to get started: # pip install git+https://github.com/deepset-ai/haystack-experimental.git@multi-file-converter-unclassified
# pip install haystack-ai markdown-it-py mdit_plain openpyxl pandas pypdf python-docx python-pptx trafilatura
from haystack import Pipeline
from haystack.components.joiners import DocumentJoiner
from haystack.components.preprocessors import DocumentSplitter, DocumentCleaner
from haystack.components.writers import DocumentWriter
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack_experimental.super_components.converters import MultiFileConverter
from pathlib import Path
document_store = InMemoryDocumentStore()
document_joiner = DocumentJoiner()
multi_file_converter = MultiFileConverter()
document_cleaner = DocumentCleaner()
document_splitter = DocumentSplitter(split_by="word", split_length=150, split_overlap=50)
document_writer = DocumentWriter(document_store)
p = Pipeline()
p.add_component("converter", multi_file_converter)
p.add_component("cleaner", document_cleaner)
p.add_component("splitter", document_splitter)
p.add_component("writer", document_writer)
p.connect("converter", "cleaner")
p.connect("cleaner", "splitter")
p.connect("splitter", "writer")
p.show()
#p.run({"converter": {"sources": list(Path("YOUR_DIRECTORY").glob("**/*"))}}) |
Beta Was this translation helpful? Give feedback.
-
With the Haystack 2.13 release, we completed the SuperComponent experiment and here is the new docs page. And here is a tutorial on how to create your own. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is the discussion board for the experimental SuperComponent class.
This experiment allows to wrap any pipeline into a friendly component interface and to create your own super components.
🧑🍳 See the PR that adds the experiment here
🧑🍳 See an example of super components here
Beta Was this translation helpful? Give feedback.
All reactions