feat: add VTT file support to Document Extractor (#11148)

This commit is contained in:
Hiroshi Fujita 2024-11-27 12:42:42 +09:00 committed by GitHub
parent 9789905a1f
commit a918cea2fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -113,7 +113,7 @@ def _extract_text_by_mime_type(*, file_content: bytes, mime_type: str) -> str:
def _extract_text_by_file_extension(*, file_content: bytes, file_extension: str) -> str:
"""Extract text from a file based on its file extension."""
match file_extension:
case ".txt" | ".markdown" | ".md" | ".html" | ".htm" | ".xml":
case ".txt" | ".markdown" | ".md" | ".html" | ".htm" | ".xml" | ".vtt":
return _extract_text_from_plain_text(file_content)
case ".json":
return _extract_text_from_json(file_content)