16 lines
650 B
Plaintext
16 lines
650 B
Plaintext
# get_llm_online_check_models.dspy — 上线检查用模型下拉(value=模型名,test_model_call 按名调用)
|
||
dbname = get_module_dbname('pipeline_llm')
|
||
try:
|
||
async with get_sor_context(request._run_ns, dbname) as sor:
|
||
recs = await sor.sqlExe(
|
||
"SELECT name, capability, status FROM llm_model WHERE status='active' ORDER BY name", {})
|
||
await sor.sqlExe("COMMIT", {})
|
||
except Exception as e:
|
||
return {"success": False, "message": str(e), "data": []}
|
||
out = []
|
||
for r in (recs or []):
|
||
n = getattr(r, 'name', '') or ''
|
||
c = getattr(r, 'capability', '') or ''
|
||
out.append({"value": n, "text": (n + '(' + c + ')') if c else n})
|
||
return out
|