feat: 统一错误提示

This commit is contained in:
CaIon
2024-03-20 20:36:55 +08:00
parent a8d242fcb2
commit 5aad98d736
8 changed files with 35 additions and 25 deletions
+1 -1
View File
@@ -154,7 +154,7 @@ func OpenaiHandler(c *gin.Context, resp *http.Response, promptTokens int, model
completionTokens := 0
for _, choice := range textResponse.Choices {
stringContent := string(choice.Message.Content)
ctkm, _ := service.CountTokenText(stringContent, model, false)
ctkm, _, _ := service.CountTokenText(stringContent, model, false)
completionTokens += ctkm
if checkSensitive {
sensitive, words, stringContent := service.SensitiveWordReplace(stringContent, false)