Update the sandbox pre-installed package and sandbox timeout (#104)

This commit is contained in:
Tianjing Zeng
2026-01-16 16:09:53 +08:00
committed by GitHub
parent bf2d75ff0f
commit 9503bda45d
5 changed files with 9 additions and 26 deletions

View File

@@ -31,7 +31,6 @@ from .ds_agent_utils import (
files_filter_pre_reply_hook, files_filter_pre_reply_hook,
add_ds_specific_tool, add_ds_specific_tool,
set_run_ipython_cell, set_run_ipython_cell,
install_package,
) )
from .ds_agent_utils.ds_config import PROMPT_DS_BASE_PATH from .ds_agent_utils.ds_config import PROMPT_DS_BASE_PATH
@@ -70,7 +69,6 @@ class DataScienceAgent(AliasAgentBase):
state_saving_dir=state_saving_dir, state_saving_dir=state_saving_dir,
) )
install_package(self.toolkit.sandbox)
set_run_ipython_cell(self.toolkit.sandbox) set_run_ipython_cell(self.toolkit.sandbox)
self.uploaded_files: List[str] = [] self.uploaded_files: List[str] = []

View File

@@ -5,7 +5,6 @@ from .utils import (
model_call_with_retry, model_call_with_retry,
set_run_ipython_cell, set_run_ipython_cell,
get_prompt_from_file, get_prompt_from_file,
install_package,
) )
from .ds_toolkit import add_ds_specific_tool from .ds_toolkit import add_ds_specific_tool
from .prompt_selector import LLMPromptSelector from .prompt_selector import LLMPromptSelector
@@ -19,7 +18,6 @@ __all__ = [
"model_call_with_retry", "model_call_with_retry",
"get_prompt_from_file", "get_prompt_from_file",
"set_run_ipython_cell", "set_run_ipython_cell",
"install_package",
"add_ds_specific_tool", "add_ds_specific_tool",
"LLMPromptSelector", "LLMPromptSelector",
"files_filter_pre_reply_hook", "files_filter_pre_reply_hook",

View File

@@ -95,21 +95,3 @@ def set_run_ipython_cell(sandbox):
print( print(
sandbox.call_tool("run_ipython_cell", {"code": summarize_chart_code}), sandbox.call_tool("run_ipython_cell", {"code": summarize_chart_code}),
) )
def install_package(sandbox):
pkgs = [
# "pandas",
# "matplotlib",
# "numpy",
# "seaborn",
# "scipy",
# "scikit-learn",
"agentscope",
"qdrant-client",
]
command = f"pip install {' '.join(pkgs)}"
sandbox.call_tool(
name="run_shell_command",
arguments={"command": command},
)

View File

@@ -3,6 +3,9 @@ worker_processes 1;
events { worker_connections 1024; } events { worker_connections 1024; }
http { http {
proxy_connect_timeout 120s;
proxy_send_timeout 120s;
proxy_read_timeout 120s;
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
default_type application/octet-stream; default_type application/octet-stream;
@@ -40,4 +43,4 @@ http {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
} }
} }
} }

View File

@@ -1,9 +1,9 @@
ipython==8.31.0 ipython==8.31.0
fastapi==0.115.6 fastapi==0.115.6
uvicorn==0.34.0 uvicorn==0.34.0
pydantic==2.10.5 pydantic==2.12.5
requests==2.32.3 requests==2.32.3
mcp==1.9.0 mcp==1.25.0
aiofiles aiofiles
uv uv
gitpython gitpython
@@ -13,4 +13,6 @@ pandas
scikit-learn scikit-learn
scipy scipy
seaborn seaborn
matplotlib matplotlib
agentscope[full]==1.0.11
qdrant-client==1.15.1