We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0ea991f + f03a5dd commit c7b197fCopy full SHA for c7b197f
metagpt/tools/tool_registry.py
@@ -9,7 +9,6 @@
9
10
import inspect
11
import os
12
-import re
13
from collections import defaultdict
14
15
import yaml
@@ -109,7 +108,8 @@ def decorator(cls):
109
108
# Get the file path where the function / class is defined and the source code
110
file_path = inspect.getfile(cls)
111
if "metagpt" in file_path:
112
- file_path = re.search("metagpt.+", file_path).group(0)
+ # split to handle ../metagpt/metagpt/tools/... where only metapgt/tools/... is needed
+ file_path = "metagpt" + file_path.split("metagpt")[-1]
113
source_code = inspect.getsource(cls)
114
115
TOOL_REGISTRY.register_tool(
0 commit comments