MCPcopy Create free account
hub / github.com/Noumena-Network/code / getFastModeState

Function getFastModeState

src/utils/fastMode.ts:320–336  ·  view source on GitHub ↗
(
  model: ModelSetting,
  fastModeUserEnabled: boolean | undefined,
)

Source from the content-addressed store, hash-verified

318}
319
320export function getFastModeState(
321 model: ModelSetting,
322 fastModeUserEnabled: boolean | undefined,
323): 'off' | 'cooldown' | 'on' {
324 const enabled =
325 isFastModeEnabled() &&
326 isFastModeAvailable() &&
327 !!fastModeUserEnabled &&
328 isFastModeSupportedByModel(model)
329 if (enabled && isFastModeCooldown()) {
330 return 'cooldown'
331 }
332 if (enabled) {
333 return 'on'
334 }
335 return 'off'
336}
337
338// Disabled reason returned by the API. The API is the canonical source for why
339// fast mode is disabled (free account, admin preference, extra usage not enabled).

Callers 3

submitMessageMethod · 0.85
buildSystemInitMessageFunction · 0.85
handleInitializeRequestFunction · 0.85

Calls 4

isFastModeEnabledFunction · 0.85
isFastModeAvailableFunction · 0.85
isFastModeCooldownFunction · 0.85

Tested by

no test coverage detected