feat(token): add cross-group retry option for token processing

This commit is contained in:
CaIon
2025-12-12 17:59:21 +08:00
parent 0b9f6a58bc
commit 01b4039e96
8 changed files with 38 additions and 8 deletions

View File

@@ -317,7 +317,7 @@ func EstimateRequestToken(c *gin.Context, meta *types.TokenCountMeta, info *rela
for i, file := range meta.Files {
switch file.FileType {
case types.FileTypeImage:
if common.IsOpenAITextModel(info.OriginModelName) {
if common.IsOpenAITextModel(model) {
token, err := getImageToken(file, model, info.IsStream)
if err != nil {
return 0, fmt.Errorf("error counting image token, media index[%d], original data[%s], err: %v", i, file.OriginData, err)