MCPcopy
hub / github.com/continuedev/continue / countImageTokens

Function countImageTokens

core/llm/countTokens.ts:87–92  ·  view source on GitHub ↗
(content: MessagePart)

Source from the content-addressed store, hash-verified

85}
86
87function countImageTokens(content: MessagePart): number {
88 if (content.type === "imageUrl") {
89 return 1024;
90 }
91 throw new Error("Non-image content type");
92}
93
94async function countTokensAsync(
95 content: MessageContent,

Callers 2

countTokensAsyncFunction · 0.85
countTokensFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected