From 99e3f9b9fcaf4fb19c73434ac37c835eee23e634 Mon Sep 17 00:00:00 2001 From: "P. Taylor Goetz" Date: Thu, 23 May 2024 18:16:35 -0400 Subject: [PATCH] limit change to only Markdown --- backend/app/parsing.py | 1 - backend/tests/unit_tests/agent_executor/test_parsing.py | 2 -- backend/tests/unit_tests/agent_executor/test_upload.py | 1 - backend/tests/unit_tests/fixtures/sample.yaml | 6 ------ frontend/src/constants.ts | 2 +- 5 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 backend/tests/unit_tests/fixtures/sample.yaml diff --git a/backend/app/parsing.py b/backend/app/parsing.py index cde62d9a..a41006ee 100644 --- a/backend/app/parsing.py +++ b/backend/app/parsing.py @@ -9,7 +9,6 @@ "text/markdown": TextParser(), "text/plain": TextParser(), "text/html": BS4HTMLParser(), - "text/yaml": TextParser(), "application/msword": MsWordParser(), "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ( MsWordParser() diff --git a/backend/tests/unit_tests/agent_executor/test_parsing.py b/backend/tests/unit_tests/agent_executor/test_parsing.py index a218b264..d233f2ca 100644 --- a/backend/tests/unit_tests/agent_executor/test_parsing.py +++ b/backend/tests/unit_tests/agent_executor/test_parsing.py @@ -28,8 +28,6 @@ def test_attempt_to_parse_each_fixture() -> None: continue seen_mimetypes.add(type_) blob = Blob.from_path(path) - if not blob.mimetype: - blob.mimetype = type_ documents = MIMETYPE_BASED_PARSER.parse(blob) try: assert len(documents) == 1 diff --git a/backend/tests/unit_tests/agent_executor/test_upload.py b/backend/tests/unit_tests/agent_executor/test_upload.py index 9129360a..2761d8c0 100644 --- a/backend/tests/unit_tests/agent_executor/test_upload.py +++ b/backend/tests/unit_tests/agent_executor/test_upload.py @@ -48,5 +48,4 @@ def test_mimetype_guessing() -> None: "sample.pdf": "application/pdf", "sample.rtf": "application/rtf", "sample.txt": "text/plain", - "sample.yaml": "text/yaml", } == name_to_mime diff --git a/backend/tests/unit_tests/fixtures/sample.yaml b/backend/tests/unit_tests/fixtures/sample.yaml deleted file mode 100644 index 7940faae..00000000 --- a/backend/tests/unit_tests/fixtures/sample.yaml +++ /dev/null @@ -1,6 +0,0 @@ -Foo: - Bar: 1 - Baz: 2 - LangChain: "🦜" - -# Path: backend/tests/unit_tests/fixtures/sample.jso \ No newline at end of file diff --git a/frontend/src/constants.ts b/frontend/src/constants.ts index 18e9629d..dfdcb8eb 100644 --- a/frontend/src/constants.ts +++ b/frontend/src/constants.ts @@ -27,7 +27,7 @@ export type TYPE_NAME = (typeof TYPES)[keyof typeof TYPES]["id"]; export const DROPZONE_CONFIG = { multiple: true, accept: { - "text/*": [".txt", ".htm", ".html", ".md",".yml", ".yaml"], + "text/*": [".txt", ".htm", ".html", ".md"], "application/pdf": [".pdf"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [ ".docx",