Upgrade the declarative pipeline for cleaner interface (#51)

This commit is contained in:
Nguyen Trung Duc (john)
2023-10-24 11:12:22 +07:00
committed by GitHub
parent aab982ddc4
commit 9035e25666
26 changed files with 365 additions and 169 deletions

View File

@@ -1,7 +1,7 @@
from haystack.schema import Document as HaystackDocument
from kotaemon.documents.base import Document, RetrievedDocument
from .conftest import skip_when_haystack_not_installed
def test_document_constructor_with_builtin_types():
for value in ["str", 1, {}, set(), [], tuple, None]:
@@ -19,7 +19,10 @@ def test_document_constructor_with_document():
assert doc2.content == doc1.content
@skip_when_haystack_not_installed
def test_document_to_haystack_format():
from haystack.schema import Document as HaystackDocument
text = "Sample text"
metadata = {"filename": "sample.txt"}
doc = Document(text, metadata=metadata)