Wang Lin

Results 13 comments of Wang Lin

When will release the this version?

You can try to use https://github.com/forestwanglin/openai-java SDK if you use Java as client language.

> 怎么加入群啊,有问题验证,不知道答案 已经加入,原来在首页

When tool message's size equal 1, it use `String` to calculate even if the `String` is a `JSON` format. When the size is large than 1 and tool message's content...

感谢,的确不能保证和官方返回一模一样。 可以看到官方的cookbook[How_to_count_tokens_with_tiktoken](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb)中也是提到 ![image](https://github.com/forestwanglin/openai-java/assets/2397372/75307ace-c24e-4fa8-8db9-28cec9add3b4) 也是一个预估值,这个计算方法主要是用来预估发送的一些limit,所以有一点误差不会影响逻辑。

token计算不支持 gpt-3.5-turbo-0301

我按照官方Demo的计算规则,更新了计算方法。 已经测试的: - gpt-3.5-turbo(gpt-3.5-turbo-0613/gpt-3.5-turbo-16k-0613) - gpt-3.5-turbo-1106 - gpt-4-1106-preview - gpt-4(gpt-4-0613/gpt-4-32k-0613) 更新了funciton的计算规则,具体可参考[FunctionFormat](https://github.com/forestwanglin/openai-java/blob/main/jtokkit/src/main/java/xyz/felh/openai/jtokkit/utils/FunctionFormat.java)

More issue about token calculation can be found issue #4.

Sorry to hear that. Em...JDK 1.8 is released in 2014 while JDK21 is release on April 2024. You may use JDK 21 if the project you created lately. Or you...