17 lines
951 B
Plaintext
17 lines
951 B
Plaintext
# get_model_options.dspy — 角色模型配置下拉(value=模型注册名)
|
||
# 2026-09-04 收敛:实现统一在模型治理模块 pipeline_llm.selection.model_options,
|
||
# 本文件只作 URL 入口。保留历史格式:首项「缺省(用项目默认模型)」+ value/text 两列。
|
||
# capabilities='chat':角色模型也是会话/任务 agent 用的对话模型,只列 t2t/i2t/m2t
|
||
# (2026-09-06 用户定夺;防把 embedding 等非对话模型配给角色后推理链报能力不匹配)。
|
||
|
||
rows = [{'value': '', 'text': '缺省(用项目默认模型)'}]
|
||
try:
|
||
org_id = await get_userorgid()
|
||
if org_id:
|
||
opts = await llm_model_options(org_id, value_field='name', capabilities='chat')
|
||
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)
|