Skip to content

Commit

Permalink
fix tool import bugs (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzhangpurdue authored May 15, 2024
1 parent 3effcd8 commit 9d6f9ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modelscope_agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _register_tool(self,

# check if the tenant_id of tool instance or tool service are exists
# TODO: change from use_tool_api=True to False, to get the tenant_id of the tool changes to
if tenant_id in tool_class_with_tenant:
if tenant_id in tool_class_with_tenant and self.use_tool_api:
return

try:
Expand Down
4 changes: 1 addition & 3 deletions modelscope_agent/tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ def __contains__(self, key):
def register_tool(name):

def decorator(cls):
if name not in TOOL_REGISTRY:
TOOL_REGISTRY[name] = {}
TOOL_REGISTRY[name]['class'] = cls
TOOL_REGISTRY[name] = {'class': cls}
return cls

return decorator
Expand Down

0 comments on commit 9d6f9ac

Please sign in to comment.