haystack/docs/v1.7.0/_src/api/api/file_classifier.md
tstadel baefd32b6f
Upgrade to v1.7.0 and copy docs folder (#3014)
* update version to 1.7.0

* copy docs

* update openapi

* generate schemas

* make update_json_schema() idempotent

* update docs, schema and openapi
2022-08-15 14:20:30 +02:00

1005 B

Module file_type

FileTypeClassifier

class FileTypeClassifier(BaseComponent)

Route files in an Indexing Pipeline to corresponding file converters.

FileTypeClassifier.__init__

def __init__(supported_types: List[str] = DEFAULT_TYPES)

Node that sends out files on a different output edge depending on their extension.

Arguments:

  • supported_types: The file types that this node can distinguish between. The default values are: txt, pdf, md, docx, and html. Lists with duplicate elements are not allowed.

FileTypeClassifier.run

def run(file_paths: Union[Path, List[Path], str, List[str], List[Union[Path, str]]])

Sends out files on a different output edge depending on their extension.

Arguments:

  • file_paths: paths to route on different edges.