feat: 初步兼容midjourney-proxy-plus

This commit is contained in:
CaIon
2024-03-13 15:37:01 +08:00
parent 95d8059c90
commit 37c0c8ebdd
14 changed files with 246 additions and 153 deletions

View File

@@ -11,6 +11,13 @@ import (
"strings"
)
func MidjourneyErrorWrapper(code int, desc string) *dto.MidjourneyResponse {
return &dto.MidjourneyResponse{
Code: code,
Description: desc,
}
}
// OpenAIErrorWrapper wraps an error into an OpenAIErrorWithStatusCode
func OpenAIErrorWrapper(err error, code string, statusCode int) *dto.OpenAIErrorWithStatusCode {
text := err.Error()