MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / resolve_under_workspace

Method resolve_under_workspace

functions/function_calling/file.py:62–67  ·  view source on GitHub ↗
(self, relative_path: str | Path)

Source from the content-addressed store, hash-verified

60 return path
61
62 def resolve_under_workspace(self, relative_path: str | Path) -> Path:
63 rel = Path(relative_path)
64 target = rel.resolve() if rel.is_absolute() else (self.workspace_root / rel).resolve()
65 if self.workspace_root not in target.parents and target != self.workspace_root:
66 raise ValueError("Path is outside workspace")
67 return target
68
69 def resolve_under_session(self, relative_path: str | Path) -> Path:
70 raw = Path(relative_path)

Callers 13

list_directoryFunction · 0.95
create_folderFunction · 0.95
delete_pathFunction · 0.95
load_fileFunction · 0.95
save_fileFunction · 0.95
read_text_file_snippetFunction · 0.95
read_file_segmentFunction · 0.95
apply_text_editsFunction · 0.95
rename_pathFunction · 0.95
copy_pathFunction · 0.95
move_pathFunction · 0.95
_get_filesFunction · 0.45

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected