| Package | Description |
|---|---|
| xyz.felh.openai.jtokkit.api | |
| xyz.felh.openai.jtokkit.utils |
| Modifier and Type | Method and Description |
|---|---|
EncodingType |
ModelType.getEncodingType()
Returns the encoding type that is used by this model type.
|
static EncodingType |
EncodingType.valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static EncodingType[] |
EncodingType.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
| Modifier and Type | Method and Description |
|---|---|
static java.util.Optional<EncodingType> |
EncodingType.fromName(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
Encoding |
EncodingRegistry.getEncoding(EncodingType encodingType)
Returns the encoding with the given type.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
TikTokenUtils.decode(EncodingType encodingType,
java.util.List<java.lang.Integer> encoded)
通过EncodingType和encoded编码数组,反推字符串文本
|
static java.util.List<java.lang.Integer> |
TikTokenUtils.encode(EncodingType encodingType,
java.lang.String text)
获取encode的编码数组
|
static Encoding |
TikTokenUtils.getEncoding(EncodingType encodingType)
获取一个Encoding对象,通过Encoding类型
|
static int |
TikTokenUtils.tokens(EncodingType encodingType,
java.lang.String text)
计算指定字符串的tokens,通过EncodingType
|
Copyright © 2023. All Rights Reserved.