We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3effcd8 commit 9d6f9acCopy full SHA for 9d6f9ac
modelscope_agent/agent.py
@@ -124,7 +124,7 @@ def _register_tool(self,
124
125
# check if the tenant_id of tool instance or tool service are exists
126
# TODO: change from use_tool_api=True to False, to get the tenant_id of the tool changes to
127
- if tenant_id in tool_class_with_tenant:
+ if tenant_id in tool_class_with_tenant and self.use_tool_api:
128
return
129
130
try:
modelscope_agent/tools/base.py
@@ -118,9 +118,7 @@ def __contains__(self, key):
118
def register_tool(name):
119
120
def decorator(cls):
121
- if name not in TOOL_REGISTRY:
122
- TOOL_REGISTRY[name] = {}
123
- TOOL_REGISTRY[name]['class'] = cls
+ TOOL_REGISTRY[name] = {'class': cls}
return cls
return decorator
0 commit comments