Importing FileTypeRouter
imports all converters
#8649
Labels
P2
Medium priority, add to the next sprint if no P1 available
FileTypeRouter
imports all converters
#8649
Describe the bug
When using/importing
FileTypeRouter
all converters are imported as well. This makes it a heavier operation than necessary and can increase the probability for further issues (e.g. cyclic dependencies, load-time, import deadlocks when used in multithreaded env). E.g. importingAzureOCRDocumentConverter
loads additional external depencies.Line causing this:
haystack/haystack/components/routers/file_type_router.py
Line 12 in 7829242
Error message
Expected behavior
Using/importing
FileTypeRouter
does not load all converters / has no dependency to converters.E.g. the two methods in question could be moved to the
haystack.utils
module.Additional context
To Reproduce
FAQ Check
System:
The text was updated successfully, but these errors were encountered: