From 4e1e52d0c2ac47f8b0b0cf83b13fbdccf9ae9ce3 Mon Sep 17 00:00:00 2001 From: DoraDong-2023 Date: Fri, 15 Mar 2024 22:12:57 -0400 Subject: [PATCH] updates for parameters prompt --- src/deploy/inference_dialog_server.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/deploy/inference_dialog_server.py b/src/deploy/inference_dialog_server.py index 29d714f..7c1ec04 100644 --- a/src/deploy/inference_dialog_server.py +++ b/src/deploy/inference_dialog_server.py @@ -907,8 +907,13 @@ def run_pipeline_after_doublechecking_API_selection(self, user_input): api_name_tmp = list(api_name_tmp_list.keys())[0] apis_name+=f"{api_name_tmp}" apis_description+=f"{self.API_composite[api_name_tmp]['description']}." - api_docstring = json_to_docstring(apis_name, apis_description, api_parameters_information) - parameters_prompt = prepare_parameters_prompt(self.user_query, api_docstring, parameters_name_list) + try: + tmp_api_parameters_information = self.API_composite[apis_name]['Parameters'] + api_docstring = json_to_docstring(apis_name, apis_description, tmp_api_parameters_information)###TODO: here only works for one api, if we add compositeAPI or classAPI in the future, we need to buildup a parameters selection for multiple API!!! + parameters_prompt = prepare_parameters_prompt(self.user_query, api_docstring, parameters_name_list) + print('parameters_prompt:', parameters_prompt) + except Exception as e: + print('error for parameters: ', e) if len(parameters_name_list)==0: # if there is no required parameters, skip using gpt response = "[]"