diff --git a/wwwroot/api/get_model_options.dspy b/wwwroot/api/get_model_options.dspy index 386e549..86305f7 100644 --- a/wwwroot/api/get_model_options.dspy +++ b/wwwroot/api/get_model_options.dspy @@ -1,10 +1,9 @@ import json -result = json.dumps([{'value': '', 'text': '缺省(用项目默认模型)'}], ensure_ascii=False) try: async with get_sor_context(request._run_ns, 'pipeline') as sor: - rows = await sor.sqlExe("select name as value, name as text from llm where status='active' order by name") + rows = await sor.sqlExe("select name as value, name as text from llm where status='active' order by name", {}) r = [{'value': '', 'text': '缺省(用项目默认模型)'}] + list(rows) return json.dumps(r, ensure_ascii=False) except Exception as e: debug(f'get_model_options error: {e}') -return json.dumps(result, ensure_ascii=False) +return json.dumps([{'value': '', 'text': '缺省(用项目默认模型)'}], ensure_ascii=False) diff --git a/wwwroot/api/get_project_select_options.dspy b/wwwroot/api/get_project_select_options.dspy index 906c5f6..010d25e 100644 --- a/wwwroot/api/get_project_select_options.dspy +++ b/wwwroot/api/get_project_select_options.dspy @@ -1,10 +1,9 @@ import json -result = json.dumps([{'value': '', 'text': '请选择'}], ensure_ascii=False) try: async with get_sor_context(request._run_ns, 'pipeline') as sor: - rows = await sor.sqlExe("select id as value, name as text from sd_projects order by created_at desc") + rows = await sor.sqlExe("select id as value, name as text from sd_projects order by created_at desc", {}) r = [{'value': '', 'text': '请选择'}] + list(rows) return json.dumps(r, ensure_ascii=False) except Exception as e: debug(f'get_project_select_options error: {e}') -return json.dumps(result, ensure_ascii=False) +return json.dumps([{'value': '', 'text': '请选择'}], ensure_ascii=False)