diff --git a/api/core/tools/provider/builtin/novitaai/tools/novitaai_modelquery.py b/api/core/tools/provider/builtin/novitaai/tools/novitaai_modelquery.py index 637dd70e55..ec2927675e 100644 --- a/api/core/tools/provider/builtin/novitaai/tools/novitaai_modelquery.py +++ b/api/core/tools/provider/builtin/novitaai/tools/novitaai_modelquery.py @@ -42,17 +42,18 @@ class NovitaAiModelQueryTool(BuiltinTool): result_str = '' if result_type == 'first sd_name': - result_str = models_data[0]['sd_name_in_api'] + result_str = models_data[0]['sd_name_in_api'] if len(models_data) > 0 else '' elif result_type == 'first name sd_name pair': - result_str = json.dumps({'name': models_data[0]['name'], 'sd_name': models_data[0]['sd_name_in_api']}) + result_str = json.dumps({'name': models_data[0]['name'], 'sd_name': models_data[0]['sd_name_in_api']}) if len(models_data) > 0 else '' elif result_type == 'sd_name array': - sd_name_array = [model['sd_name_in_api'] for model in models_data] + sd_name_array = [model['sd_name_in_api'] for model in models_data] if len(models_data) > 0 else [] result_str = json.dumps(sd_name_array) elif result_type == 'name array': - name_array = [model['name'] for model in models_data] + name_array = [model['name'] for model in models_data] if len(models_data) > 0 else [] result_str = json.dumps(name_array) elif result_type == 'name sd_name pair array': - name_sd_name_pair_array = [{'name': model['name'], 'sd_name': model['sd_name_in_api']} for model in models_data] + name_sd_name_pair_array = [{'name': model['name'], 'sd_name': model['sd_name_in_api']} + for model in models_data] if len(models_data) > 0 else [] result_str = json.dumps(name_sd_name_pair_array) elif result_type == 'whole info array': result_str = json.dumps(models_data) diff --git a/api/core/tools/provider/builtin/novitaai/tools/novitaai_modelquery.yaml b/api/core/tools/provider/builtin/novitaai/tools/novitaai_modelquery.yaml index a933f76d0e..a14795e45e 100644 --- a/api/core/tools/provider/builtin/novitaai/tools/novitaai_modelquery.yaml +++ b/api/core/tools/provider/builtin/novitaai/tools/novitaai_modelquery.yaml @@ -19,7 +19,8 @@ parameters: human_description: en_US: Seaching the content of sd_name, name, tags. zh_Hans: 搜索 sd_name、name、tags 中的内容 - form: form + llm_description: Enter the content to search + form: llm - name: result_type type: select default: "first sd_name"