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

Class NonWorkerAsyncEncoder

core/llm/countTokens.ts:38–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38class NonWorkerAsyncEncoder implements AsyncEncoder {
39 constructor(private readonly encoding: Encoding) {}
40
41 async close(): Promise<void> {}
42
43 async encode(text: string): Promise<number[]> {
44 return this.encoding.encode(text);
45 }
46
47 async decode(tokens: number[]): Promise<string> {
48 return this.encoding.decode(tokens);
49 }
50}
51
52let gptEncoding: Encoding | null = null;
53const llamaEncoding = new LlamaEncoding();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected