MCPcopy
hub / github.com/OpenBMB/ChatDev / _derive_module_name

Function _derive_module_name

utils/function_catalog.py:144–157  ·  view source on GitHub ↗
(file_path: str, functions_dir: Path)

Source from the content-addressed store, hash-verified

142
143
144def _derive_module_name(file_path: str, functions_dir: Path) -> str:
145 if not file_path:
146 return "unknown"
147 try:
148 relative = Path(file_path).resolve().relative_to(functions_dir.resolve())
149 if relative.suffix:
150 relative = relative.with_suffix("")
151 parts = list(relative.parts)
152 if not parts:
153 return "unknown"
154 return "/".join(parts)
155 except Exception:
156 stem = Path(file_path).stem
157 return stem or "unknown"
158
159
160def _extract_description(fn: Any) -> str | None:

Callers 1

_build_function_metadataFunction · 0.85

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected