feat: Refactor message handling and update dependencies

- Added required packages to go.mod: `github.com/Laisky/errors/v2 v2.0.1`, `github.com/stretchr/testify v1.8.3`, `github.com/davecgh/go-spew v1.1.1`, `github.com/pmezard/go-difflib v1.0.0`
- Increased the number of returned recordings to 100 in `relay-utils.go`
- Refactored and simplified code in `relay-aiproxy.go` for improved message retrieval and error handling
- Added new test file `relay_test.go` and various test cases for different message types
- Modified functions in `group.go` and `relay.go` for improved functionality
This commit is contained in:
Laisky.Cai
2023-11-17 03:24:55 +00:00
parent 8d270c8c9a
commit 8b477d896d
8 changed files with 98 additions and 60 deletions

4
go.mod
View File

@@ -3,6 +3,7 @@ module one-api
go 1.21
require (
github.com/Laisky/errors/v2 v2.0.1
github.com/gin-contrib/cors v1.4.0
github.com/gin-contrib/gzip v0.0.6
github.com/gin-contrib/sessions v0.0.5
@@ -12,6 +13,7 @@ require (
github.com/go-redis/redis/v8 v8.11.5
github.com/google/uuid v1.4.0
github.com/pkoukk/tiktoken-go v0.1.6
github.com/stretchr/testify v1.8.3
golang.org/x/crypto v0.15.0
gorm.io/driver/mysql v1.5.2
gorm.io/driver/postgres v1.5.4
@@ -23,6 +25,7 @@ require (
github.com/bytedance/sonic v1.9.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
@@ -47,6 +50,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/arch v0.3.0 // indirect