MCPcopy Index your code
hub / github.com/OpenBMB/ToolBench / run

Function run

toolbench/inference/server.py:79–93  ·  view source on GitHub ↗
(toolbench_code_string, toolbench_api_name, toolbench_input_params_str)

Source from the content-addressed store, hash-verified

77 return return_dict, save_cache_flag, switch_flag
78
79def run(toolbench_code_string, toolbench_api_name, toolbench_input_params_str):
80 # get observation
81 success_flag = False
82 switch_flag = False
83 save_cache = False
84 exec(toolbench_code_string)
85 try:
86 eval_func_str = f"{toolbench_api_name}({toolbench_input_params_str})"
87 new_func = eval(eval_func_str)
88 response, save_cache, switch_flag = process_error(new_func)
89 success_flag = True
90 except Exception as e:
91 response = {"error": f"Function executing {toolbench_code_string} error...\n{e}", "response": ""}
92 save_cache = False
93 return success_flag, switch_flag, response, save_cache
94
95
96def dict_shorten(origin: dict, schema: dict):

Callers 1

get_rapidapi_responseFunction · 0.85

Calls 1

process_errorFunction · 0.85

Tested by

no test coverage detected