MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / countTokens

Method countTokens

src/api/index.ts:125–125  ·  view source on GitHub ↗

* Counts tokens for content blocks * All providers extend BaseProvider which provides a default tiktoken implementation, * but they can override this to use their native token counting endpoints * * @param content The content to count tokens for * @returns A promise resolving to the token

(content: Array<Anthropic.Messages.ContentBlockParam>)

Source from the content-addressed store, hash-verified

123 * @returns A promise resolving to the token count
124 */
125 countTokens(content: Array<Anthropic.Messages.ContentBlockParam>): Promise<number>
126}
127
128export function buildApiHandler(configuration: ProviderSettings): ApiHandler {

Callers 3

attemptApiRequestMethod · 0.65
estimateTokenCountFunction · 0.65
summarizeConversationFunction · 0.65

Implementers 2

VsCodeLmHandlersrc/api/providers/vscode-lm.ts
FakeAIHandlersrc/api/providers/fake-ai.ts

Calls

no outgoing calls

Tested by

no test coverage detected