Use path.as_uri() instead of path.resolve()
This commit is contained in:
parent
8132a44994
commit
ee57bc0a82
2 changed files with 3 additions and 3 deletions
|
|
@ -88,7 +88,7 @@ class HaikuRAG:
|
||||||
if not source_path.exists():
|
if not source_path.exists():
|
||||||
raise ValueError(f"File does not exist: {source_path}")
|
raise ValueError(f"File does not exist: {source_path}")
|
||||||
|
|
||||||
uri = str(source_path.resolve())
|
uri = source_path.as_uri()
|
||||||
md5_hash = hashlib.md5(source_path.read_bytes()).hexdigest()
|
md5_hash = hashlib.md5(source_path.read_bytes()).hexdigest()
|
||||||
|
|
||||||
# Check if document already exists
|
# Check if document already exists
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ async def test_client_create_document_from_source():
|
||||||
|
|
||||||
assert doc.id is not None
|
assert doc.id is not None
|
||||||
assert doc.content == test_content
|
assert doc.content == test_content
|
||||||
assert doc.uri == str(temp_path.resolve())
|
assert doc.uri == temp_path.as_uri()
|
||||||
assert doc.metadata["source_type"] == "file"
|
assert doc.metadata["source_type"] == "file"
|
||||||
assert "contentType" in doc.metadata
|
assert "contentType" in doc.metadata
|
||||||
assert "md5" in doc.metadata
|
assert "md5" in doc.metadata
|
||||||
|
|
@ -109,7 +109,7 @@ async def test_client_create_document_from_source():
|
||||||
|
|
||||||
assert doc2.id is not None
|
assert doc2.id is not None
|
||||||
assert doc2.content == test_content
|
assert doc2.content == test_content
|
||||||
assert doc2.uri == str(temp_path.resolve())
|
assert doc2.uri == temp_path.as_uri()
|
||||||
assert "contentType" in doc2.metadata
|
assert "contentType" in doc2.metadata
|
||||||
assert "md5" in doc2.metadata
|
assert "md5" in doc2.metadata
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue