fix: tools_dict issue

This commit is contained in:
Timothy Jaeryang Baek
2026-02-23 16:25:38 -06:00
parent 176f9a7816
commit 3c8d658160
+4 -3
View File
@@ -2531,7 +2531,6 @@ async def process_chat_payload(request, form_data, user, metadata, model):
{"type": "function", "function": tool.get("spec", {})} {"type": "function", "function": tool.get("spec", {})}
for tool in tools_dict.values() for tool in tools_dict.values()
] ]
else: else:
# If the function calling is not native, then call the tools function calling handler # If the function calling is not native, then call the tools function calling handler
try: try:
@@ -4322,7 +4321,8 @@ async def streaming_chat_response_handler(response, ctx):
code = sanitize_code(code) code = sanitize_code(code)
if CODE_INTERPRETER_BLOCKED_MODULES: if CODE_INTERPRETER_BLOCKED_MODULES:
blocking_code = textwrap.dedent(f""" blocking_code = textwrap.dedent(
f"""
import builtins import builtins
BLOCKED_MODULES = {CODE_INTERPRETER_BLOCKED_MODULES} BLOCKED_MODULES = {CODE_INTERPRETER_BLOCKED_MODULES}
@@ -4338,7 +4338,8 @@ async def streaming_chat_response_handler(response, ctx):
return _real_import(name, globals, locals, fromlist, level) return _real_import(name, globals, locals, fromlist, level)
builtins.__import__ = restricted_import builtins.__import__ = restricted_import
""") """
)
code = blocking_code + "\n" + code code = blocking_code + "\n" + code
if ( if (