diff --git a/relay/adaptor/xunfei/main.go b/relay/adaptor/xunfei/main.go index 3b171b1f..cadc4c48 100644 --- a/relay/adaptor/xunfei/main.go +++ b/relay/adaptor/xunfei/main.go @@ -39,7 +39,9 @@ func requestOpenAI2Xunfei(request model.GeneralOpenAIRequest, xunfeiAppId string } xunfeiRequest := ChatRequest{} xunfeiRequest.Header.AppId = xunfeiAppId - xunfeiRequest.Header.PatchId = xunfeiPatchId + if xunfeiPatchId != "" { + xunfeiRequest.Header.PatchId = []string{xunfeiPatchId} + } xunfeiRequest.Parameter.Chat.Domain = domain xunfeiRequest.Parameter.Chat.Temperature = request.Temperature xunfeiRequest.Parameter.Chat.TopK = request.N diff --git a/relay/adaptor/xunfei/model.go b/relay/adaptor/xunfei/model.go index 3741a6e5..e22b22e4 100644 --- a/relay/adaptor/xunfei/model.go +++ b/relay/adaptor/xunfei/model.go @@ -15,8 +15,8 @@ type Functions struct { type ChatRequest struct { Header struct { - AppId string `json:"app_id"` - PatchId string `json:"patch_id,omitempty"` + AppId string `json:"app_id"` + PatchId []string `json:"patch_id,omitempty"` } `json:"header"` Parameter struct { Chat struct {