diff --git a/erniebot-agent/src/erniebot_agent/agents/base.py b/erniebot-agent/src/erniebot_agent/agents/base.py index 8886fdcb8..10646cd7e 100644 --- a/erniebot-agent/src/erniebot_agent/agents/base.py +++ b/erniebot-agent/src/erniebot_agent/agents/base.py @@ -27,11 +27,11 @@ ToolResponse, ) from erniebot_agent.chat_models.base import ChatModel -from erniebot_agent.file import protocol +from erniebot_agent.file import get_global_file_manager, protocol from erniebot_agent.file.base import File from erniebot_agent.file.file_manager import FileManager -from erniebot_agent.memory.base import Memory from erniebot_agent.memory import Message, SystemMessage +from erniebot_agent.memory.base import Memory from erniebot_agent.tools.base import BaseTool from erniebot_agent.tools.tool_manager import ToolManager from erniebot_agent.utils.mixins import GradioMixin @@ -77,7 +77,7 @@ def __init__( else: self._callback_manager = CallbackManager(callbacks) if file_manager is None: - file_manager = file.get_global_file_manager() + file_manager = get_global_file_manager() self.plugins = plugins self._file_manager = file_manager self._init_file_repr() diff --git a/erniebot-agent/src/erniebot_agent/file/global_file_manager.py b/erniebot-agent/src/erniebot_agent/file/global_file_manager.py index 7a6afc329..c4bfd329c 100644 --- a/erniebot-agent/src/erniebot_agent/file/global_file_manager.py +++ b/erniebot-agent/src/erniebot_agent/file/global_file_manager.py @@ -16,8 +16,8 @@ import asyncio_atexit # type: ignore -from erniebot_agent.file_io.file_manager import FileManager -from erniebot_agent.file_io.remote_file import AIStudioFileClient +from erniebot_agent.file.file_manager import FileManager +from erniebot_agent.file.remote_file import AIStudioFileClient from erniebot_agent.utils import config_from_environ as C _global_file_manager: Optional[FileManager] = None diff --git a/erniebot-agent/src/erniebot_agent/tools/remote_toolkit.py b/erniebot-agent/src/erniebot_agent/tools/remote_toolkit.py index 68ba69964..62cdbf8b3 100644 --- a/erniebot-agent/src/erniebot_agent/tools/remote_toolkit.py +++ b/erniebot-agent/src/erniebot_agent/tools/remote_toolkit.py @@ -14,7 +14,12 @@ from erniebot_agent.file import get_global_file_manager from erniebot_agent.file.file_manager import FileManager -from erniebot_agent.memory.messages import AIMessage, FunctionCall, HumanMessage, Message +from erniebot_agent.memory.messages import ( + AIMessage, + FunctionCall, + HumanMessage, + Message, +) from erniebot_agent.tools.remote_tool import RemoteTool, tool_registor from erniebot_agent.tools.schema import ( Endpoint, diff --git a/erniebot-agent/src/erniebot_agent/utils/config_from_environ.py b/erniebot-agent/src/erniebot_agent/utils/config_from_environ.py index 28cc48931..83b883fbb 100644 --- a/erniebot-agent/src/erniebot_agent/utils/config_from_environ.py +++ b/erniebot-agent/src/erniebot_agent/utils/config_from_environ.py @@ -15,14 +15,9 @@ import os from typing import Optional -<<<<<<<< HEAD:erniebot-agent/src/erniebot_agent/utils/config_from_environ.py def get_global_access_token() -> Optional[str]: return _get_val_from_env_var("EB_AGENT_ACCESS_TOKEN") -======== -from erniebot_agent.file.file_manager import FileManager -from erniebot_agent.file.remote_file import AIStudioFileClient ->>>>>>>> official:erniebot-agent/src/erniebot_agent/file/factory.py def get_global_save_dir() -> Optional[str]: diff --git a/erniebot-agent/tests/unit_tests/file/test_local_file.py b/erniebot-agent/tests/unit_tests/file/test_local_file.py index b06052ba3..52cbec45c 100644 --- a/erniebot-agent/tests/unit_tests/file/test_local_file.py +++ b/erniebot-agent/tests/unit_tests/file/test_local_file.py @@ -1,8 +1,8 @@ import pathlib import tempfile -import erniebot_agent.file_io.protocol as protocol -from erniebot_agent.file_io.local_file import LocalFile, create_local_file_from_path +import erniebot_agent.file.protocol as protocol +from erniebot_agent.file.local_file import LocalFile, create_local_file_from_path def test_create_local_file_from_path():