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

Method _build_module_name

utils/function_manager.py:83–88  ·  view source on GitHub ↗

Create a unique module name for a function file.

(self, filepath: Path)

Source from the content-addressed store, hash-verified

81 self._loaded = True
82
83 def _build_module_name(self, filepath: Path) -> str:
84 """Create a unique module name for a function file."""
85 relative = filepath.relative_to(self.functions_dir)
86 parts = "_".join(relative.with_suffix("").parts) or "module"
87 unique_suffix = f"{abs(hash(filepath.as_posix())) & 0xFFFFFFFF:X}"
88 return f"{_MODULE_PREFIX}.{parts}_{unique_suffix}"
89
90 def get_function(self, name: str) -> Optional[Callable]:
91 """Get a function by name."""

Callers 1

load_functionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected