Skip to content

Commit 2d502d6

Browse files
committed
go: do not respect disabled zen models
1 parent 2ad190e commit 2d502d6

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • packages/console/app/src/routes/zen/util

packages/console/app/src/routes/zen/util/handler.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export async function handler(
132132
retry,
133133
stickyProvider,
134134
)
135-
validateModelSettings(authInfo)
135+
validateModelSettings(billingSource, authInfo)
136136
updateProviderKey(authInfo, providerInfo)
137137
logger.metric({ provider: providerInfo.id })
138138

@@ -768,9 +768,10 @@ export async function handler(
768768
return "balance"
769769
}
770770

771-
function validateModelSettings(authInfo: AuthInfo) {
772-
if (!authInfo) return
773-
if (authInfo.isDisabled) throw new ModelError(t("zen.api.error.modelDisabled"))
771+
function validateModelSettings(billingSource: BillingSource, authInfo: AuthInfo) {
772+
if (billingSource === "lite") return
773+
if (billingSource === "anonymous") return
774+
if (authInfo!.isDisabled) throw new ModelError(t("zen.api.error.modelDisabled"))
774775
}
775776

776777
function updateProviderKey(authInfo: AuthInfo, providerInfo: ProviderInfo) {

0 commit comments

Comments
 (0)