From 178ac2451a9ca2b438bbaec5210fba98359ba479 Mon Sep 17 00:00:00 2001 From: ymq Date: Sat, 22 Aug 2026 11:21:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20options=20dspy=20=E8=A1=A5=20sqlExe=20?= =?UTF-8?q?=E7=9A=84=20ns=20=E5=8F=82=E6=95=B0=20+=20=E4=BF=AE=E5=A4=8D=20?= =?UTF-8?q?result=20=E5=8F=8C=E5=BA=8F=E5=88=97=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/get_model_options.dspy | 5 ++--- wwwroot/api/get_project_select_options.dspy | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) 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)