Check if filename is already in relative path

This commit is contained in:
SwiftyOS
2023-09-28 12:03:30 +02:00
parent f0087ab80a
commit ece0f9189f

View File

@@ -199,7 +199,10 @@ class Agent:
"""
try:
artifact = await self.db.get_artifact(artifact_id)
file_path = os.path.join(artifact.relative_path, artifact.file_name)
if artifact.file_name not in artifact.relative_path:
file_path = os.path.join(artifact.relative_path, artifact.file_name)
else:
file_path = artifact.relative_path
retrieved_artifact = self.workspace.read(task_id=task_id, path=file_path)
except NotFoundError as e:
raise