gpt-token-utils
Version:
Isomorphic utilities for GPT-3 tokenization and prompt building.
29 lines (28 loc) • 901 B
text/typescript
/**
* @copyright Sister Software. All rights reserved.
* @author Teffen Ellis, et al.
* @license
* See LICENSE file in the project root for full license information.
*/
declare const nodeInspectSymbol: unique symbol;
/**
* Two-way map of byte values to their corresponding Unicode codepoints.
*/
export declare class CodePointByteMap {
/**
* Maps each byte value to its corresponding Unicode character.
*/
protected _byteToCodePoint: Map<number, string>;
/**
* Maps each Unicode character to its corresponding byte value.
*/
protected _codePointToByte: Map<string, number>;
constructor();
byteToCodePoint(byte: number): string;
codePointToByte(codePoint: string): number;
get size(): number;
get byteToCodePointMap(): Map<number, string>;
get codePointToByteMap(): Map<string, number>;
[nodeInspectSymbol](): string;
}
export {};