feat: 统一错误提示

This commit is contained in:
CaIon committed 2024-03-20 20:36:55 +08:00
1 parent a8d242fcb2
commit 5aad98d736
8 files changed
+35 -25

No files matched your search

+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)