MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / estimateTokens

Method estimateTokens

context/TokenUtils.cpp:17–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15namespace QodeAssist::Context {
16
17int TokenUtils::estimateTokens(const QString &text)
18{
19 if (text.isEmpty()) {
20 return 0;
21 }
22
23 // TODO: need to improve
24 return text.length() / 4;
25}
26
27bool TokenUtils::isImageFilePath(const QString &filePath)
28{

Callers

nothing calls this directly

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected