mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-08 01:43:07 +00:00
fix(codex): show catalog-default Fast tier (#1179)
* fix(codex): show catalog-default Fast tier * fix(web): show inherited Fast tier in header
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
type CodexModelCatalogEntry = {
|
||||
id: string
|
||||
isDefault: boolean
|
||||
defaultServiceTier?: string | null
|
||||
serviceTiers?: string[]
|
||||
}
|
||||
|
||||
@@ -47,7 +48,15 @@ export function codexModelAdvertisesFastTier(
|
||||
}
|
||||
|
||||
export function isFastServiceTier(serviceTier?: string | null): boolean {
|
||||
return serviceTier?.trim().toLowerCase() === 'fast'
|
||||
return /^(fast|priority)$/i.test(serviceTier?.trim() ?? '')
|
||||
}
|
||||
|
||||
export function getEffectiveCodexServiceTier(
|
||||
serviceTier: string | null | undefined,
|
||||
sessionModel: string | null | undefined,
|
||||
models: ReadonlyArray<CodexModelCatalogEntry>
|
||||
): string | null | undefined {
|
||||
return serviceTier ?? findActiveModel(sessionModel, models)?.defaultServiceTier
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user