From 02c0c6501ecf669e43ab9dac58d4b8d47a1a9877 Mon Sep 17 00:00:00 2001 From: "1808837298@qq.com" <1808837298@qq.com> Date: Tue, 8 Oct 2024 23:15:57 +0800 Subject: [PATCH] feat: update auto disable --- service/channel.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/service/channel.go b/service/channel.go index b370a43..047550d 100644 --- a/service/channel.go +++ b/service/channel.go @@ -73,6 +73,15 @@ func ShouldDisableChannel(channelType int, err *relaymodel.OpenAIErrorWithStatus } else if strings.HasPrefix(err.Error.Message, "Permission denied") { return true } + + if strings.Contains(err.Error.Message, "The security token included in the request is invalid") { // anthropic + return true + } else if strings.Contains(err.Error.Message, "Operation not allowed") { + return true + } else if strings.Contains(err.Error.Message, "Your account is not authorized") { + return true + } + return false }