You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the initialization code of the rapidapi_wrapper class located in toolbench/inference/Downstream_tasks/rapidapi.py (lines 77-82):
if self.retriever is not None:
query_json = self.retrieve_rapidapi_tools(self.input_description, args.retrieved_api_nums, args.tool_root_dir)
data_dict = self.fetch_api_json(query_json)
tool_descriptions = self.build_tool_description(data_dict)
else:
data_dict = self.fetch_api_json(query_json)
When self.retriever is None, the data_dict is passed through the fetch_api_json function, but tool_descriptions is not built from the filtered data_dict (unlike the code in the if branch). This results in a mismatch between api_list and tool_descriptions when constructing the function lists later on (lines 84-85).
Here is the relevant code in toolbench/inference/Downstream_tasks/rapidapi.py (lines 84-91):
for k,api_json in enumerate(data_dict["api_list"]):
standard_tool_name = tool_descriptions[k][0]
openai_function_json,cate_name, pure_api_name = self.api_json_to_openai_json(api_json,standard_tool_name)
self.functions.append(openai_function_json)
self.api_name_reflect[openai_function_json["name"]] = pure_api_name
self.tool_names.append(standard_tool_name)
self.cate_names.append(cate_name)
This bug causes significant issues with prompt construction and function calling to the RapidAPI server, as the mismatch between api_list and tool_descriptions can lead to wrong function lists and subsequent wrong API requests.
The text was updated successfully, but these errors were encountered:
In the initialization code of the
rapidapi_wrapper
class located intoolbench/inference/Downstream_tasks/rapidapi.py
(lines 77-82):When
self.retriever
isNone
, thedata_dict
is passed through thefetch_api_json
function, buttool_descriptions
is not built from the filtereddata_dict
(unlike the code in theif
branch). This results in a mismatch betweenapi_list
andtool_descriptions
when constructing the function lists later on (lines 84-85).Here is the relevant code in
toolbench/inference/Downstream_tasks/rapidapi.py
(lines 84-91):This bug causes significant issues with prompt construction and function calling to the RapidAPI server, as the mismatch between
api_list
andtool_descriptions
can lead to wrong function lists and subsequent wrong API requests.The text was updated successfully, but these errors were encountered: