pipeline-llm/wwwroot/api/get_llm_online_check_models.dspy

16 lines
650 B
Plaintext
Raw Permalink 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_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