class ChatCompletion extends BaseChatCompletion implements Serializable {

    /**
     * 问题描述
     */
    @NonNull
    private List<Message> messages;

    /**
     * 获取当前参数的tokens数
     */
    public long tokens() {<FILL_FUNCTION_BODY>}
}

        if (CollectionUtil.isEmpty(this.messages) || StrUtil.isBlank(this.getModel())) {
            log.warn("参数异常model：{}，prompt：{}", this.getModel(), this.messages);
            return 0;
        }
        return TikTokensUtil.tokens(this.getModel(), this.messages);
    
<methods>public non-sealed void <init>() <variables>private double frequencyPenalty,private java.lang.Object functionCall,private List<com.unfbx.chatgpt.entity.chat.Functions> functions,private Map#RAW logitBias,private java.lang.Integer maxTokens,private java.lang.String model,private java.lang.Integer n,private double presencePenalty,private com.unfbx.chatgpt.entity.chat.ResponseFormat responseFormat,private java.lang.Integer seed,private List<java.lang.String> stop,private boolean stream,private double temperature,private java.lang.Object toolChoice,private List<com.unfbx.chatgpt.entity.chat.tool.Tools> tools,private java.lang.Double topP,private java.lang.String user