This commit is contained in:
Timothy Jaeryang Baek
2026-02-25 15:15:59 -06:00
parent 636ab99ad8
commit 345f3e3559
12 changed files with 41 additions and 26 deletions

View File

@@ -4321,8 +4321,7 @@ async def streaming_chat_response_handler(response, ctx):
code = sanitize_code(code)
if CODE_INTERPRETER_BLOCKED_MODULES:
blocking_code = textwrap.dedent(
f"""
blocking_code = textwrap.dedent(f"""
import builtins
BLOCKED_MODULES = {CODE_INTERPRETER_BLOCKED_MODULES}
@@ -4338,8 +4337,7 @@ async def streaming_chat_response_handler(response, ctx):
return _real_import(name, globals, locals, fromlist, level)
builtins.__import__ = restricted_import
"""
)
""")
code = blocking_code + "\n" + code
if (