mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-18 14:27:10 +00:00
feat: 初步支持function call(WIP)
This commit is contained in:
parent
4a4dceec18
commit
97b3acbf3b
24 changed files with 13607 additions and 841 deletions
6
utils/openai/tokenizer.js
Normal file
6
utils/openai/tokenizer.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { getEncoding } from 'js-tiktoken';
|
||||
// TODO: make this configurable
|
||||
var tokenizer = getEncoding('cl100k_base');
|
||||
export function encode(input) {
|
||||
return new Uint32Array(tokenizer.encode(input));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue