Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/continuedev/continue
/ encode
Function
encode
core/llm/tiktokenWorkerPool.mjs:6–8 ·
view source on GitHub ↗
(text)
Source
from the content-addressed store, hash-verified
4
const
tiktokenEncoding = _encodingForModel(
"gpt-4"
);
5
6
function
encode(text) {
7
return
tiktokenEncoding.encode(text,
"all"
, []);
8
}
9
10
function
decode(tokens) {
11
return
tiktokenEncoding.decode(tokens);
Callers
8
shouldAutoCompact
Function · 0.50
countContentTokens
Function · 0.50
countToolCallFunctionTokens
Function · 0.50
countToolOutputTokens
Function · 0.50
countChatHistoryItemTokens
Function · 0.50
countParameterFieldTokens
Function · 0.50
countSingleToolTokens
Function · 0.50
countTotalInputTokens
Function · 0.50
Calls
1
encode
Method · 0.65
Tested by
no test coverage detected