File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed
Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def log_handler(level: str, message: str):
1818
1919
2020async def main ():
21- async with code_sandbox (dependencies = ['numpy' ], log_handler = log_handler , logging_level = 'debug' ) as sandbox :
21+ async with code_sandbox (dependencies = ['numpy' ], log_handler = log_handler ) as sandbox :
2222 print ('running code' )
2323 result = await sandbox .eval (code )
2424 print (f'{ result ["status" ].title ()} :' )
Original file line number Diff line number Diff line change @@ -42,15 +42,13 @@ async def code_sandbox(
4242 * ,
4343 dependencies : list [str ] | None = None ,
4444 log_handler : LogHandler | None = None ,
45- logging_level : mcp_types .LoggingLevel | None = None ,
4645 allow_networking : bool = True ,
4746) -> AsyncIterator ['CodeSandbox' ]:
4847 """Run code in a secure sandbox.
4948
5049 Args:
5150 dependencies: A list of dependencies to be installed.
5251 log_handler: A callback function to handle print statements when code is running.
53- logging_level: The logging level to use for the print handler, defaults to `info` if `log_handler` is provided.
5452 deps_log_handler: A callback function to run on log statements during initial install of dependencies.
5553 allow_networking: Whether to allow networking or not while executing python code.
5654 """
@@ -75,5 +73,5 @@ async def logging_callback_(params: mcp_types.LoggingMessageNotificationParams)
7573 async with stdio_client (server_params ) as (read , write ):
7674 async with ClientSession (read , write , logging_callback = logging_callback ) as session :
7775 if log_handler :
78- await session .set_logging_level (logging_level or 'info ' )
76+ await session .set_logging_level ('debug ' )
7977 yield CodeSandbox (session )
You can’t perform that action at this time.
0 commit comments