diff --git a/rdagent/utils/agent/tpl.py b/rdagent/utils/agent/tpl.py index 28345c34..6b44c57b 100644 --- a/rdagent/utils/agent/tpl.py +++ b/rdagent/utils/agent/tpl.py @@ -54,7 +54,11 @@ class RDAT: if path_part.startswith("."): yaml_file_path = caller_dir / f"{path_part[1:].replace('.', '/')}.yaml" - self.uri = f"{str(caller_dir.resolve().relative_to(PROJ_PATH)).replace('/', '.')}{uri}" + try: + # modify the uri to a raltive path to the project for easier finding prompts.yaml + self.uri = f"{str(caller_dir.resolve().relative_to(PROJ_PATH)).replace('/', '.')}{uri}" + except ValueError: + pass else: yaml_file_path = (PROJ_PATH / path_part.replace(".", "/")).with_suffix(".yaml")