MCPcopy Index your code
hub / github.com/continuedev/continue / count

Function count

core/llm/countTokens.ts:136–137  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

134// https://community.openai.com/t/how-to-calculate-the-tokens-when-using-function-call/266573/10
135function countToolsTokens(tools: Tool[], modelName: string): number {
136 const count = (value: string) =>
137 encodingForModel(modelName).encode(value).length;
138
139 let numTokens = 12;
140

Callers 1

countToolsTokensFunction · 0.85

Calls 2

encodingForModelFunction · 0.85
encodeMethod · 0.65

Tested by

no test coverage detected