pipeline-sdlc/wwwroot/api/get_model_options.dspy

15 lines
711 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# get_model_options.dspy — 角色模型配置下拉value=模型注册名)
# 2026-09-04 收敛:实现统一在模型治理模块 pipeline_llm.selection.model_options
# 本文件只作 URL 入口。保留历史格式:首项「缺省(用项目默认模型)」+ value/text 两列。
rows = [{'value': '', 'text': '缺省(用项目默认模型)'}]
try:
org_id = await get_userorgid()
if org_id:
opts = await llm_model_options(org_id, value_field='name')
rows += [{'value': r['value'], 'text': r['text']} for r in opts]
return json.dumps(rows, ensure_ascii=False)
except Exception as e:
debug(f'get_model_options error: {e}')
return json.dumps(rows, ensure_ascii=False)