feat: 初步兼容流模式下openai渠道类型转为claude格式访问 #862

This commit is contained in:
1808837298@qq.com
2025-03-13 19:32:08 +08:00
parent c25d4d8d23
commit 7e46d4217d
37 changed files with 390 additions and 165 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/gorilla/websocket"
"io"
"net/http"
common2 "one-api/common"
"one-api/relay/common"
"one-api/relay/constant"
"one-api/service"
@@ -31,6 +32,9 @@ func DoApiRequest(a Adaptor, c *gin.Context, info *common.RelayInfo, requestBody
if err != nil {
return nil, fmt.Errorf("get request url failed: %w", err)
}
if common2.DebugEnabled {
println("fullRequestURL:", fullRequestURL)
}
req, err := http.NewRequest(c.Request.Method, fullRequestURL, requestBody)
if err != nil {
return nil, fmt.Errorf("new request failed: %w", err)