mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-28 05:33:36 +00:00
11 lines
372 B
TypeScript
11 lines
372 B
TypeScript
/** Process-local model context window cache keyed by model id. */
|
|
export const MODEL_CONTEXT_TOKEN_CACHE = new Map<string, number>();
|
|
|
|
/** Looks up cached context-token count for a model id. */
|
|
export function lookupCachedContextTokens(modelId?: string): number | undefined {
|
|
if (!modelId) {
|
|
return undefined;
|
|
}
|
|
return MODEL_CONTEXT_TOKEN_CACHE.get(modelId);
|
|
}
|