feat(core): compact v2 session context (#30986)
This commit is contained in:
parent
a7bd1cd0d0
commit
beae7290f3
26 changed files with 569 additions and 296 deletions
5
packages/core/src/util/token.ts
Normal file
5
packages/core/src/util/token.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export * as Token from "./token"
|
||||
|
||||
const CHARS_PER_TOKEN = 4
|
||||
|
||||
export const estimate = (input: string) => Math.max(0, Math.round(input.length / CHARS_PER_TOKEN))
|
||||
Loading…
Add table
Add a link
Reference in a new issue