Skip to content

Commit

Permalink
Refine badcase for user input. v1.0.35
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Dec 16, 2023
1 parent 924f420 commit 459fda8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,6 @@ The changelog:
* Detect user silent and warning. v1.0.32
* Refine bot log for the first time. [v1.0.33](https://github.com/ossrs/ai-talk/releases/tag/v1.0.33)
* Allow user retry when error. v1.0.34
* Refine badcase for user input. v1.0.35

Winlin, 2023.12
9 changes: 6 additions & 3 deletions backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,12 @@ func handleUploadQuestionAudio(ctx context.Context, w http.ResponseWriter, r *ht
strings.Contains(asrText, "支持明鏡與點點欄目") {
return errors.Errorf("badcase: %v", asrText)
}
}
if robot.asrLanguage == "en" {
if strings.ToLower(asrText) == "you" {
if strings.Contains(asrText, "字幕由") && strings.Contains(asrText, "社群提供") {
return errors.Errorf("badcase: %v", asrText)
}
} else if robot.asrLanguage == "en" {
if strings.ToLower(asrText) == "you" ||
strings.Count(asrText, ".") == len(asrText) {
return errors.Errorf("badcase: %v", asrText)
}
}
Expand Down

0 comments on commit 459fda8

Please sign in to comment.