Spaces:
Running
Running
Update tests.py
Browse files
tests.py
CHANGED
@@ -264,11 +264,11 @@ def run_code(python_packages:str,filename: str, code: str,start_cmd:str,forever_
|
|
264 |
|
265 |
|
266 |
@mcp.tool()
|
267 |
-
def run_code_files(start_cmd:str) -> dict:
|
268 |
-
"""(start_cmd:Example- python /app/code_interpreter/app.py or bash /app/code_interpreter/app.py).The files must be inside the /app/code_interpreter directory."""
|
269 |
global files_list
|
270 |
|
271 |
-
stdot=run(start_cmd, 300)
|
272 |
onlyfiles = glob.glob("/app/code_interpreter/*")
|
273 |
onlyfiles=list(set(onlyfiles)-set(files_list))
|
274 |
uploaded_filenames=[]
|
@@ -283,9 +283,9 @@ def run_code_files(start_cmd:str) -> dict:
|
|
283 |
|
284 |
|
285 |
@mcp.tool()
|
286 |
-
def run_shell_command(cmd:str) -> dict:
|
287 |
-
"""(cmd:Example- mkdir test.By default , the command is run inside the /app/code_interpreter/ directory.).Remember, the code_interpreter is running on **alpine linux** , so write commands accordingly.Eg-sudo does not work and is not required
|
288 |
-
output=run(cmd, 300)
|
289 |
transfer_files()
|
290 |
return {"output":output}
|
291 |
|
|
|
264 |
|
265 |
|
266 |
@mcp.tool()
|
267 |
+
def run_code_files(start_cmd:str,forever_cmd:bool)) -> dict:
|
268 |
+
"""(start_cmd:Example- python /app/code_interpreter/app.py or bash /app/code_interpreter/app.py).The files must be inside the /app/code_interpreter directory.forever_cmd:If True, the command will run indefinitely.Set to True, when runnig a website/server. If False, the command will time out after 300 second and the result will be returned."""
|
269 |
global files_list
|
270 |
|
271 |
+
stdot=run(start_cmd, 300,forever_cmd)
|
272 |
onlyfiles = glob.glob("/app/code_interpreter/*")
|
273 |
onlyfiles=list(set(onlyfiles)-set(files_list))
|
274 |
uploaded_filenames=[]
|
|
|
283 |
|
284 |
|
285 |
@mcp.tool()
|
286 |
+
def run_shell_command(cmd:str,forever_cmd:bool) -> dict:
|
287 |
+
"""(cmd:Example- mkdir test.By default , the command is run inside the /app/code_interpreter/ directory.).Remember, the code_interpreter is running on **alpine linux** , so write commands accordingly.Eg-sudo does not work and is not required. forever_cmd: If True, the command will run indefinitely.Set to True, when running a website/server. If False, the command will time out after 300 second and the result will be returned."""
|
288 |
+
output=run(cmd, 300,forever_cmd)
|
289 |
transfer_files()
|
290 |
return {"output":output}
|
291 |
|