Browse Source

fix Runtime import (#2897)

Xingyao Wang 1 năm trước cách đây
mục cha
commit
ced7499f8d
2 tập tin đã thay đổi với 3 bổ sung7 xóa
  1. 1 6
      opendevin/runtime/__init__.py
  2. 2 1
      opendevin/server/session/agent.py

+ 1 - 6
opendevin/runtime/__init__.py

@@ -1,15 +1,10 @@
-from typing import TYPE_CHECKING, Type
-
 from .docker.local_box import LocalBox
 from .docker.ssh_box import DockerSSHBox
 from .e2b.sandbox import E2BBox
 from .sandbox import Sandbox
 
-if TYPE_CHECKING:
-    from .runtime import Runtime
-
 
-def get_runtime_cls(name: str) -> Type['Runtime']:
+def get_runtime_cls(name: str):
     # Local imports to avoid circular imports
     if name == 'server':
         from .server.runtime import ServerRuntime

+ 2 - 1
opendevin/server/session/agent.py

@@ -9,7 +9,8 @@ from opendevin.core.logger import opendevin_logger as logger
 from opendevin.core.schema import ConfigType
 from opendevin.events.stream import EventStream
 from opendevin.llm.llm import LLM
-from opendevin.runtime import DockerSSHBox, Runtime, get_runtime_cls
+from opendevin.runtime import DockerSSHBox, get_runtime_cls
+from opendevin.runtime.runtime import Runtime
 
 
 class AgentSession: