Sfoglia il codice sorgente

feat: update chatgpt-4o token encoder

CalciumIon 1 anno fa
parent
commit
e3b3fdec48
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      service/token_counter.go

+ 1 - 1
service/token_counter.go

@@ -52,7 +52,7 @@ func InitTokenEncoders() {
 }
 
 func getModelDefaultTokenEncoder(model string) *tiktoken.Tiktoken {
-	if strings.HasPrefix(model, "gpt-4o") {
+	if strings.HasPrefix(model, "gpt-4o") || strings.HasPrefix(model, "chatgpt-4o") {
 		return cl200kTokenEncoder
 	}
 	return defaultTokenEncoder