mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-27 14:25:20 +02:00
avoid private fn registry, add some tests
This commit is contained in:
parent
3b001572d9
commit
9d453c5c10
2 changed files with 24 additions and 2 deletions
|
|
@ -12,6 +12,8 @@ def convert_code_to_tool_schema(obj, include: list[str] = None):
|
|||
if inspect.isclass(obj):
|
||||
schema = {"type": "class", "description": remove_spaces(docstring), "methods": {}}
|
||||
for name, method in inspect.getmembers(obj, inspect.isfunction):
|
||||
if name.startswith("_"): # skip private methodss
|
||||
continue
|
||||
if include and name not in include:
|
||||
continue
|
||||
# method_doc = inspect.getdoc(method)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue