pipeline-sdlc/wwwroot/api/get_model_options.dspy
ymq 3785622bac feat: 项目角色模型配置 CRUD 界面(模型配置设置界面)
- sd_project_role_models CRUD(index.ui + get/add/update/delete dspy)
- 下拉选项:get_model_options(模型)/get_role_options(角色)/get_project_select_options(项目)
- load_path 注册权限路径 + models 表模型
2026-08-22 11:17:27 +08:00

11 lines
541 B
Plaintext

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")
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)