fix: llminference.dspy 增加余额/定价校验拦截
checkCustomerBalance 返回值 f 之前被丢弃,导致即使余额不足或 模型未配置定价,直接调 API 仍可执行推理。 添加 if not f 判断,返回 UiError 拦截。
This commit is contained in:
parent
6bc04897ab
commit
3b25b9cfb4
@ -11,6 +11,8 @@ userorgid = await get_userorgid()
|
||||
if userid is None:
|
||||
return UiError(title='llm inference', message='Please login first')
|
||||
f = await checkCustomerBalance(params_kw.llmid, userid, userorgid)
|
||||
if not f:
|
||||
return UiError(title='llm inference', message='余额不足或模型未配置定价')
|
||||
kdbids = params_kw.kdbids
|
||||
if kdbids:
|
||||
data = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user