pipeline-llm/wwwroot/api/get_llm_protocol_options.dspy
yumoqing 660ad21365 feat(pipeline-llm): 模型治理模块v1.0.0 — 供应商/端点目录/账号钱包/模型注册/组织容错策略/限额限流/双维度记账
- 8张llm_前缀表(手写幂等DDL): vendor/account/model/api_profile/org_policy/org_quota/user_quota/usage
- gateway.py 门禁链: 限流→限额→策略选模型(主备容错)→账号×端点轮转(偏好过滤+余额加权+冷却避让)→预授权-结算
- api_key AES单层加密(非RC4,盐不对称不可解); 限流Redis分钟窗口(db4) fail-open
- 双维度记账: 一次调用同行记cost(账号侧)+charge(组织池侧); 充值=recharge行
- CRUD+index.ui 8卡片导航+总览; appcodes字典5组; 设计规范+30测试用例
- 策略即开关: 机构无策略→__LEGACY__走旧llm表(向后兼容零改动)
2026-09-01 17:27:17 +08:00

12 lines
581 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_llm_protocol_options.dspy — appcodes_kv 下拉选项parentid=llm_protocol
dbname = get_module_dbname('pipeline_llm')
try:
async with get_sor_context(request._run_ns, dbname) as sor:
recs = await sor.sqlExe(
"SELECT k, v FROM appcodes_kv WHERE parentid=${p}$ ORDER BY k",
{"p": "llm_protocol"})
await sor.sqlExe("COMMIT", {})
except Exception as e:
return {"success": False, "message": str(e), "data": []}
return [{"value": getattr(r, "k", ""), "text": getattr(r, "v", "") or getattr(r, "k", "")} for r in (recs or [])]