operation_setting.go 903 B

1234567891011121314151617181920212223242526272829303132333435
  1. package operation_setting
  2. import "strings"
  3. var DemoSiteEnabled = false
  4. var SelfUseModeEnabled = false
  5. var AutomaticDisableKeywords = []string{
  6. "Your credit balance is too low",
  7. "This organization has been disabled.",
  8. "You exceeded your current quota",
  9. "Permission denied",
  10. "The security token included in the request is invalid",
  11. "Operation not allowed",
  12. "Your account is not authorized",
  13. // Claude Code
  14. "Invalid bearer token",
  15. "OAuth authentication is currently not allowed for this endpoint",
  16. }
  17. func AutomaticDisableKeywordsToString() string {
  18. return strings.Join(AutomaticDisableKeywords, "\n")
  19. }
  20. func AutomaticDisableKeywordsFromString(s string) {
  21. AutomaticDisableKeywords = []string{}
  22. ak := strings.Split(s, "\n")
  23. for _, k := range ak {
  24. k = strings.TrimSpace(k)
  25. k = strings.ToLower(k)
  26. if k != "" {
  27. AutomaticDisableKeywords = append(AutomaticDisableKeywords, k)
  28. }
  29. }
  30. }