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

Method iter_modules

utils/function_catalog.py:86–99  ·  view source on GitHub ↗

Return functions grouped by Python file (module_name).

(self)

Source from the content-addressed store, hash-verified

84 return self._metadata.copy()
85
86 def iter_modules(self) -> List[Tuple[str, List[FunctionMetadata]]]:
87 """Return functions grouped by Python file (module_name)."""
88
89 self._ensure_loaded()
90 modules: List[Tuple[str, List[FunctionMetadata]]] = []
91 for module_name in sorted(self._module_index.keys()):
92 names = self._module_index.get(module_name, [])
93 entries: List[FunctionMetadata] = []
94 for fn_name in names:
95 meta = self._metadata.get(fn_name)
96 if meta is not None:
97 entries.append(meta)
98 modules.append((module_name, entries))
99 return modules
100
101 def functions_for_module(self, module_name: str) -> List[str]:
102 """Return sorted function names for the given module."""

Callers 1

field_specsMethod · 0.80

Calls 2

_ensure_loadedMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected