Use path.as_uri() instead of path.resolve()

This commit is contained in:
Yiorgis Gozadinos 2025-06-20 09:27:01 +02:00
parent 8132a44994
commit ee57bc0a82
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

@ -88,7 +88,7 @@ class HaikuRAG:
if not source_path.exists():
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()
# Check if document already exists

View file

@ -98,7 +98,7 @@ async def test_client_create_document_from_source():
assert doc.id is not None
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 "contentType" 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.content == test_content
assert doc2.uri == str(temp_path.resolve())
assert doc2.uri == temp_path.as_uri()
assert "contentType" in doc2.metadata
assert "md5" in doc2.metadata