This commit is contained in:
Timothy Jaeryang Baek
2026-03-06 15:42:13 -06:00
parent 576ee92438
commit 4ab831b259
+1
View File
@@ -4163,6 +4163,7 @@ async def streaming_chat_response_handler(response, ctx):
tool_args = tool_call.get("function", {}).get("arguments", "{}") tool_args = tool_call.get("function", {}).get("arguments", "{}")
tool_function_params = {} tool_function_params = {}
if tool_args and tool_args.strip():
try: try:
# json.loads cannot be used because some models do not produce valid JSON # json.loads cannot be used because some models do not produce valid JSON
tool_function_params = ast.literal_eval(tool_args) tool_function_params = ast.literal_eval(tool_args)