Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lazyllm/tools/agent/toolsManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _check_return_type_is_the_same(doc_type_hints, func_type_hints) -> None:
# ---------------------------------------------------------------------------- #

class ModuleTool(ModuleBase, metaclass=LazyLLMRegisterMetaClass):
def __init__(self, verbose: bool = False, return_trace: bool = True, execute_in_sandbox: bool = True):
def __init__(self, verbose: bool = False, return_trace: bool = False, execute_in_sandbox: bool = True):
super().__init__(return_trace=return_trace)
self._verbose = verbose
func = getattr(self.apply, '__func__', self.apply)
Expand Down
7 changes: 2 additions & 5 deletions lazyllm/tools/sandbox/dummy_sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class DummySandbox(LazyLLMSandboxBase):
SUPPORTED_LANGUAGES: List[str] = ['python']

def __init__(self, timeout: int = 30, return_trace: bool = True, project_dir: Optional[str] = None,
def __init__(self, timeout: int = 30, return_trace: bool = False, project_dir: Optional[str] = None,
return_sandbox_result: bool = False):
super().__init__(return_trace=return_trace, project_dir=project_dir,
return_sandbox_result=return_sandbox_result)
Expand Down Expand Up @@ -96,10 +96,7 @@ def _execute(self, code: str, language: str, context: dict,
script_path = os.path.join(temp_dir, '_script.py')
with open(script_path, 'w', encoding='utf-8') as f:
f.write(code)
env = os.environ.copy()
env['HOME'] = temp_dir
env['PYTHONPATH'] = temp_dir
proc_result = self._run_in_subprocess(script_path, cwd=temp_dir, env=env)
proc_result = self._run_in_subprocess(script_path, cwd=temp_dir)
return _SandboxResult(
success=(proc_result['returncode'] == 0),
stdout=proc_result['stdout'],
Expand Down
2 changes: 1 addition & 1 deletion lazyllm/tools/sandbox/sandbox_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def to_dict(self) -> dict:
class LazyLLMSandboxBase(ModuleBase, metaclass=LazyLLMRegisterMetaClass):
SUPPORTED_LANGUAGES: List[str] = []

def __init__(self, output_dir_path: Optional[str] = None, return_trace: bool = True,
def __init__(self, output_dir_path: Optional[str] = None, return_trace: bool = False,
project_dir: Optional[str] = None, return_sandbox_result: bool = False):
super().__init__(return_trace=return_trace)
self._output_dir_path = output_dir_path or os.getcwd()
Expand Down
2 changes: 1 addition & 1 deletion lazyllm/tools/sandbox/sandbox_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SandboxFusion(LazyLLMSandboxBase):

def __init__(self, base_url: str = config['sandbox_fusion_base_url'], compile_timeout: int = 10,
run_timeout: int = 10, memory_limit_mb: int = -1, project_dir: str = None,
return_sandbox_result: bool = False, return_trace: bool = True):
return_sandbox_result: bool = False, return_trace: bool = False):
super().__init__(return_trace=return_trace, project_dir=project_dir, return_sandbox_result=return_sandbox_result)
self._base_url = base_url
self._compile_timeout = compile_timeout
Expand Down