From 2f2660cdf382e3f5b8545629ae2a61d4031d7c4f Mon Sep 17 00:00:00 2001 From: Zhicheng Zhang Date: Thu, 13 Jun 2024 09:39:08 +0800 Subject: [PATCH] remove complicated import which might lead import error (#484) --- apps/mobile_agent/run.py | 2 +- apps/multi_roles_chat_room/role_core.py | 2 +- docs/modules/tool.md | 2 +- modelscope_agent/agents/__init__.py | 3 --- modelscope_agent/environment/__init__.py | 1 - 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/mobile_agent/run.py b/apps/mobile_agent/run.py index ad300d81b..f45a666ad 100644 --- a/apps/mobile_agent/run.py +++ b/apps/mobile_agent/run.py @@ -2,7 +2,7 @@ import os from modelscope_agent.agents.mobile_agent_v2 import MobileAgentV2 -from modelscope_agent.environment import ADBEnvironment +from modelscope_agent.environment.android_adb import ADBEnvironment parser = argparse.ArgumentParser() parser.add_argument('--adb_path', type=str, default='./adb/adb') diff --git a/apps/multi_roles_chat_room/role_core.py b/apps/multi_roles_chat_room/role_core.py index 8d63da34e..c0c55851e 100644 --- a/apps/multi_roles_chat_room/role_core.py +++ b/apps/multi_roles_chat_room/role_core.py @@ -7,7 +7,7 @@ import ray from modelscope_agent import create_component from modelscope_agent.agent_env_util import AgentEnvMixin -from modelscope_agent.agents import MultiRolePlay +from modelscope_agent.agents.multi_role_play import MultiRolePlay from modelscope_agent.task_center import TaskCenter from story_holder import get_story_by_id diff --git a/docs/modules/tool.md b/docs/modules/tool.md index 7c48a2684..14cadc4f5 100644 --- a/docs/modules/tool.md +++ b/docs/modules/tool.md @@ -40,7 +40,7 @@ Furthermore, if the tool is a `langchain tool`, you can directly use our `Langch from langchain.tools import ShellTool from modelscope_agent.tools.langchain_proxy_tool import LangchainTool from modelscope_agent.agents import RolePlay -from modelscope_agent.tools import TOOL_REGISTRY +from modelscope_agent.tools.base import TOOL_REGISTRY # All LangchainTools should be registered in this manner, with 'terminal' being the tool name that will change according to the task. TOOL_REGISTRY['terminal'] = LangchainTool diff --git a/modelscope_agent/agents/__init__.py b/modelscope_agent/agents/__init__.py index e4027a9ad..73a6708ee 100644 --- a/modelscope_agent/agents/__init__.py +++ b/modelscope_agent/agents/__init__.py @@ -1,5 +1,2 @@ from .agent_builder import AgentBuilder -from .gen_keyword import GenKeyword -from .mobile_agent_v2 import MobileAgentV2 -from .multi_role_play import MultiRolePlay from .role_play import RolePlay diff --git a/modelscope_agent/environment/__init__.py b/modelscope_agent/environment/__init__.py index 8b48e6fdc..34d3b88aa 100644 --- a/modelscope_agent/environment/__init__.py +++ b/modelscope_agent/environment/__init__.py @@ -1,2 +1 @@ -from .android_adb import ADBEnvironment from .environment import Environment