refac
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user