feat(core): compact v2 session context (#30986)
This commit is contained in:
@@ -1,7 +1 @@
|
||||
const CHARS_PER_TOKEN = 4
|
||||
|
||||
export function estimate(input: string) {
|
||||
return Math.max(0, Math.round((input || "").length / CHARS_PER_TOKEN))
|
||||
}
|
||||
|
||||
export * as Token from "./token"
|
||||
export { Token, estimate } from "@opencode-ai/core/util/token"
|
||||
|
||||
Reference in New Issue
Block a user