feat: add video URL support in MediaContent and update token counting logic

This commit is contained in:
CaIon
2025-05-03 21:12:07 +08:00
parent fd6838e690
commit e097d5a538
3 changed files with 19 additions and 2 deletions

View File

@@ -400,6 +400,8 @@ func CountTokenMessages(info *relaycommon.RelayInfo, messages []dto.Message, mod
tokenNum += 100
} else if m.Type == dto.ContentTypeFile {
tokenNum += 5000
} else if m.Type == dto.ContentTypeVideoUrl {
tokenNum += 5000
} else {
tokenNum += getTokenNum(tokenEncoder, m.Text)
}