fix only extract and record the most critical part.

Because sometimes when certain models transfer files, the error information here becomes too long, leading to very large log sizes. Therefore, I hope that only the most critical parts are extracted and recorded when an error is logged here.
This commit is contained in:
Yanyutin753 2024-03-16 17:35:37 +08:00
parent c285e000cc
commit 02a918b149

View File

@ -102,7 +102,8 @@ func CountTokenMessages(messages []model.Message, model string) int {
} }
imageTokens, err := countImageTokens(url, detail) imageTokens, err := countImageTokens(url, detail)
if err != nil { if err != nil {
logger.SysError("error counting image tokens: " + err.Error()) //Due to the excessive length of the error information, only extract and record the most critical part.
logger.SysError(fmt.Sprintf("error counting image tokens. Error type: %T", err))
} else { } else {
tokenNum += imageTokens tokenNum += imageTokens
} }