feat: add Replicate adaptor and integrate into channel and API types

This commit is contained in:
Laisky.Cai
2024-11-28 09:04:02 +00:00
parent 3cb1b4fd35
commit ae7117beee
18 changed files with 540 additions and 8 deletions

View File

@@ -1,8 +1,16 @@
package openai
import "github.com/songquanpeng/one-api/relay/model"
import (
"context"
"fmt"
"github.com/songquanpeng/one-api/common/logger"
"github.com/songquanpeng/one-api/relay/model"
)
func ErrorWrapper(err error, code string, statusCode int) *model.ErrorWithStatusCode {
logger.Error(context.TODO(), fmt.Sprintf("[%s]%+v", code, err))
Error := model.Error{
Message: err.Error(),
Type: "one_api_error",