MCPcopy Create free account
hub / github.com/modelscope/ms-agent / __init__

Method __init__

ms_agent/tools/code/code_executor.py:94–114  ·  view source on GitHub ↗
(self, config)

Source from the content-addressed store, hash-verified

92 """
93
94 def __init__(self, config):
95 logger.info('Installing ms-enclave package...')
96 try:
97 install_package(
98 package_name='ms-enclave', import_name='ms_enclave')
99 except Exception as e:
100 raise e
101
102 super().__init__(config)
103 self.manager: Optional['SandboxManager'] = None
104 self.sandbox_id: Optional[str] = None
105 self._initialized = False
106 self._original_port: Optional[int] = None
107 self.sandbox_type: Optional['SandboxType'] = None
108
109 # Extract sandbox configuration
110 self.sandbox_config = self._build_sandbox_config(config)
111
112 self.exclude_func(getattr(config.tools, 'code_executor', None))
113
114 logger.info('CodeExecutionTool initialized (ms-enclave based)')
115
116 def _build_sandbox_config(
117 self,

Callers

nothing calls this directly

Calls 3

_build_sandbox_configMethod · 0.95
install_packageFunction · 0.90
exclude_funcMethod · 0.80

Tested by

no test coverage detected