Skip to content

Commit ff4dcdc

Browse files
committed
feat: pass through parse when md/txt
1 parent 2f35a14 commit ff4dcdc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/memos/mem_reader/read_multi_modal/file_content_parser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ def _handle_url(self, url_str: str, filename: str) -> tuple[str, str | None]:
4444
if hostname in self.direct_markdown_hostnames:
4545
return response.text, None
4646

47-
file_ext = os.path.splitext(filename)[1] or ".tmp"
47+
file_ext = os.path.splitext(filename)[1].lower()
48+
if file_ext in [".md", ".markdown", ".txt"]:
49+
return response.text, None
4850
with tempfile.NamedTemporaryFile(mode="wb", delete=False, suffix=file_ext) as temp_file:
4951
temp_file.write(response.content)
5052
return "", temp_file.name

0 commit comments

Comments
 (0)