diff --git a/adapter/request.go b/adapter/request.go index 298c00b..9db085f 100644 --- a/adapter/request.go +++ b/adapter/request.go @@ -1,7 +1,7 @@ package adapter import ( - adaptercommon "chat/adapter/common" + "chat/adapter/common" "chat/globals" "chat/utils" "fmt" @@ -30,7 +30,6 @@ func NewChatRequest(conf globals.ChannelConfig, props *adaptercommon.ChatProps, retries := conf.GetRetry() props.Current++ - fmt.Println(IsAvailableError(err)) if IsAvailableError(err) { if isQPSOverLimit(props.OriginalModel, err) { // sleep for 0.5s to avoid qps limit diff --git a/admin/statistic.go b/admin/statistic.go index c846a2e..94710ef 100644 --- a/admin/statistic.go +++ b/admin/statistic.go @@ -4,9 +4,8 @@ import ( "chat/adapter" "chat/connection" "chat/utils" - "time" - "github.com/go-redis/redis/v8" + "time" ) func IncrErrorRequest(cache *redis.Client) { diff --git a/channel/worker.go b/channel/worker.go index a69244f..245f4d3 100644 --- a/channel/worker.go +++ b/channel/worker.go @@ -2,20 +2,15 @@ package channel import ( "chat/adapter" - adaptercommon "chat/adapter/common" + "chat/adapter/common" "chat/globals" "chat/utils" "fmt" - "time" - "github.com/go-redis/redis/v8" + "time" ) func NewChatRequest(group string, props *adaptercommon.ChatProps, hook globals.Hook) error { - if err := AuditContent(props); err != nil { - return err - } - ticker := ConduitInstance.GetTicker(props.OriginalModel, group) if ticker == nil || ticker.IsEmpty() { return fmt.Errorf("cannot find channel for model %s", props.OriginalModel) diff --git a/manager/chat.go b/manager/chat.go index ed1817a..708f413 100644 --- a/manager/chat.go +++ b/manager/chat.go @@ -11,9 +11,8 @@ import ( "chat/manager/conversation" "chat/utils" "fmt" - "runtime/debug" - "github.com/gin-gonic/gin" + "runtime/debug" ) const defaultMessage = "empty response" diff --git a/utils/cache.go b/utils/cache.go index 6fb95c5..29e8dae 100644 --- a/utils/cache.go +++ b/utils/cache.go @@ -4,9 +4,8 @@ import ( "context" "errors" "fmt" - "time" - "github.com/go-redis/redis/v8" + "time" ) func Incr(cache *redis.Client, key string, delta int64) (int64, error) {