haystack
haystack copied to clipboard
Update `FileTypeRouter` so its output sockets names are valid identifiers
FileTypeRouter output sockets are MIME type names. This makes them non valid Python identifiers as they may contain invalid characters like / or -.
We must make sure that the output sockets names are valid Python identifiers so they can be used with autocompletion and can be accessed using the Sockets class.
e.g
router = FileTypeRouter(mime_types=["text/plain", "audio/x-wav", "image/jpeg"])
router.outputs.text_plain
router.outputs.audio_x_wav
We should also update all occurences that still use strings in Pipeline.connect() after this is fixed.