feat: 统一错误提示
This commit is contained in:
1 parent
a8d242fcb2
commit
5aad98d736
8 files changed
+35
-25
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user