diff --git a/astrbot/core/knowledge_base/parsers/util.py b/astrbot/core/knowledge_base/parsers/util.py index a98ed60ed2..0659fa8aa4 100644 --- a/astrbot/core/knowledge_base/parsers/util.py +++ b/astrbot/core/knowledge_base/parsers/util.py @@ -2,7 +2,15 @@ async def select_parser(ext: str) -> BaseParser: - if ext in {".md", ".txt", ".markdown", ".rst", ".adoc", ".xlsx", ".docx", ".xls"}: + if ext in {".md", ".txt", ".markdown"}: + # Plain text formats are decoded directly by TextParser and do not + # require the optional markitdown dependency. Routing them here keeps + # txt/md uploads working even when markitdown-no-magika is missing + # (see https://github.com/AstrBotDevs/AstrBot/issues/9598). + from .text_parser import TextParser + + return TextParser() + if ext in {".rst", ".adoc", ".xlsx", ".docx", ".xls"}: from .markitdown_parser import MarkitdownParser return MarkitdownParser()