Update tests.py
Browse files
tests.py
CHANGED
|
@@ -212,13 +212,13 @@ def create_code_files(filename: str, code: str) -> dict:
|
|
| 212 |
@mcp.tool()
|
| 213 |
def run_code(python_packages:str,filename: str, code: str,start_cmd:str) -> dict:
|
| 214 |
"""
|
| 215 |
-
Execute
|
| 216 |
|
| 217 |
Args:
|
| 218 |
-
python_packages: Space-separated list of packages to install (e.g., "numpy matplotlib").
|
| 219 |
Preinstalled packages: gradio, XlsxWriter, openpyxl.
|
| 220 |
filename: Name of the file to create (stored in /app/code_interpreter/).
|
| 221 |
-
code: Full
|
| 222 |
start_cmd: Command to execute the file (e.g., "python /app/code_interpreter/app.py"
|
| 223 |
or "bash /app/code_interpreter/app.py").
|
| 224 |
|
|
@@ -233,7 +233,7 @@ def run_code(python_packages:str,filename: str, code: str,start_cmd:str) -> dict
|
|
| 233 |
package_names = python_packages.strip()
|
| 234 |
command="pip install"
|
| 235 |
if not package_names:
|
| 236 |
-
|
| 237 |
|
| 238 |
run(
|
| 239 |
f"{command} --break-system-packages {package_names}", timeout_sec=300
|
|
|
|
| 212 |
@mcp.tool()
|
| 213 |
def run_code(python_packages:str,filename: str, code: str,start_cmd:str) -> dict:
|
| 214 |
"""
|
| 215 |
+
Execute code in a controlled environment with package installation and file handling.
|
| 216 |
|
| 217 |
Args:
|
| 218 |
+
python_packages[Output an empty string ,if using any other language.]: Space-separated list of packages to install (e.g., "numpy matplotlib").
|
| 219 |
Preinstalled packages: gradio, XlsxWriter, openpyxl.
|
| 220 |
filename: Name of the file to create (stored in /app/code_interpreter/).
|
| 221 |
+
code: Full code to write to the file.
|
| 222 |
start_cmd: Command to execute the file (e.g., "python /app/code_interpreter/app.py"
|
| 223 |
or "bash /app/code_interpreter/app.py").
|
| 224 |
|
|
|
|
| 233 |
package_names = python_packages.strip()
|
| 234 |
command="pip install"
|
| 235 |
if not package_names:
|
| 236 |
+
pass
|
| 237 |
|
| 238 |
run(
|
| 239 |
f"{command} --break-system-packages {package_names}", timeout_sec=300
|