- UI: 检查结果区域改为VScrollPanel(filler),两个按钮用HBox并排 - check_pricing_program.dspy: 优先显示display_text字段,回退到name字段
34 lines
1.2 KiB
Plaintext
34 lines
1.2 KiB
Plaintext
llmid = params_kw.get('llmid', '')
|
|
|
|
if not llmid:
|
|
return json.dumps({
|
|
"widgettype": "Text",
|
|
"options": {"text": "❌ 定价项目(pricing_program): 缺少llmid参数", "i18n": False}
|
|
}, ensure_ascii=False)
|
|
|
|
async with get_sor_context(request._run_ns, 'llmage') as sor:
|
|
maps = await sor.sqlExe(
|
|
"select * from llm_api_map where llmid=${llmid}$", {'llmid': llmid})
|
|
ppids = [m.ppid for m in maps if m.ppid] if maps else []
|
|
|
|
if not ppids:
|
|
text = "❌ 定价项目(pricing_program): llm_api_map中无ppid"
|
|
else:
|
|
ppid = ppids[0]
|
|
async with get_sor_context(request._run_ns, 'pricing') as psor:
|
|
pregs = await psor.sqlExe(
|
|
"select * from pricing_program where id=${ppid}$", {'ppid': ppid})
|
|
if pregs:
|
|
p = pregs[0]
|
|
display_name = getattr(p, 'display_text', '') or getattr(p, 'name', '')
|
|
text = f"✅ 定价项目(pricing_program): {display_name}"
|
|
if hasattr(p, 'id'):
|
|
text += f" (id={p.id})"
|
|
else:
|
|
text = f"❌ 定价项目(pricing_program): ppid={ppid} 未找到"
|
|
|
|
return json.dumps({
|
|
"widgettype": "Text",
|
|
"options": {"text": text, "i18n": False}
|
|
}, ensure_ascii=False)
|