MCPcopy
hub / github.com/coder/mux / buildCacheKey

Function buildCacheKey

src/node/utils/main/tokenizer.ts:141–144  ·  view source on GitHub ↗
(modelName: ModelName, text: string)

Source from the content-addressed store, hash-verified

139}
140
141function buildCacheKey(modelName: ModelName, text: string): string {
142 const checksum = CRC32.str(text);
143 return `${modelName}:${checksum}:${text.length}`;
144}
145
146async function countTokensInternal(modelName: ModelName, text: string): Promise<number> {
147 assert(typeof text === "string", "Tokenizer countTokens expects string input");

Callers 1

countTokensInternalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected