UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.52 kB
import{a as normalizeFastMode}from"./string-coerce-CpTFcSwY.mjs";import{r as resolveAgentConfig}from"./agent-scope-config-CG9CFpGX.mjs";import"./agent-scope-Dw5XRSEh.mjs";import"./thinking.shared-B2DqfPmC.mjs";import{a as resolveModelExtraParamSources,r as resolveAliasedParamValue}from"./model-extra-params-CALSEb0J.mjs";import{n as normalizeOpenAIServiceTier}from"./openai-fast-mode-BH_lVYc8.mjs";import{u as resolveFastModeModelAutoOnSeconds}from"./fast-mode-DEUN0Mjk.mjs"; //!src/agents/fast-mode.ts function resolveFastModeState(e){const{defaultParams:t,modelParams:n,agentModelParams:r,agentParams:i}=resolveModelExtraParamSources({config:e.cfg,provider:e.provider,modelId:e.model,agentId:e.agentId});const a=resolveFastModeModelAutoOnSeconds({...e,modelParamSources:[r,n]});let o=normalizeFastMode(e.sessionEntry?.fastMode);let s=`session`;if(o===void 0){o=normalizeFastMode(e.agentId&&e.cfg?resolveAgentConfig(e.cfg,e.agentId)?.fastModeDefault:e.cfg?.agents?.defaults?.fastModeDefault);s=`agent`}if(o===void 0){const e=resolveAliasedParamValue([t,n,r,i],[`fastMode`,`fast_mode`]);o=normalizeFastMode(e);s=`config`}const c=e.provider===`openai`?normalizeOpenAIServiceTier(resolveAliasedParamValue([t,n,r,i],[`serviceTier`,`service_tier`])):void 0;const l=o??(c?void 0:false);if(o===void 0&&c){o=c===`ultrafast`?`ultrafast`:c===`priority`;s=`config`}return{mode:o??false,requestMode:l,enabled:o===`auto`||o===true||o===`ultrafast`,source:o===void 0?`default`:s,fastAutoOnSeconds:a}}export{resolveFastModeState as t};