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

Method _expand_module_all_entry

entity/configs/node/tooling.py:284–307  ·  view source on GitHub ↗
(
        *,
        module_name: str,
        catalog: FunctionCatalog,
        path: str,
        original: Mapping[str, Any],
    )

Source from the content-addressed store, hash-verified

282
283 @staticmethod
284 def _expand_module_all_entry(
285 *,
286 module_name: str,
287 catalog: FunctionCatalog,
288 path: str,
289 original: Mapping[str, Any],
290 ) -> List[Tuple[Dict[str, Any], str]]:
291 disallowed = [key for key in ("description", "parameters", "auto_fill") if key in original]
292 if disallowed:
293 fields = ", ".join(disallowed)
294 raise ConfigError(
295 f"{module_name}{MODULE_ALL_SUFFIX} does not support overriding {fields}",
296 extend_path(path, "name"),
297 )
298 functions = catalog.functions_for_module(module_name)
299 if not functions:
300 raise ConfigError(
301 f"module '{module_name}' has no functions under function directory",
302 extend_path(path, "name"),
303 )
304 entries: List[Tuple[Dict[str, Any], str]] = []
305 for fn_name in functions:
306 entries.append(({"name": fn_name}, path))
307 return entries
308
309
310@dataclass

Callers 1

from_dictMethod · 0.80

Calls 3

ConfigErrorClass · 0.90
extend_pathFunction · 0.90
functions_for_moduleMethod · 0.80

Tested by

no test coverage detected