diff --git a/relay/channel/coze/constants.go b/relay/channel/coze/constants.go index da28cb83..873ffe24 100644 --- a/relay/channel/coze/constants.go +++ b/relay/channel/coze/constants.go @@ -1,8 +1,30 @@ package coze var ModelList = []string{ - // TODO: 完整列表 + "moonshot-v1-8k", + "moonshot-v1-32k", + "moonshot-v1-128k", + "Baichuan4", + "abab6.5s-chat-pro", + "glm-4-0520", + "qwen-max", + "deepseek-r1", "deepseek-v3", + "deepseek-r1-distill-qwen-32b", + "deepseek-r1-distill-qwen-7b", + "step-1v-8k", + "step-1.5v-mini", + "Doubao-pro-32k", + "Doubao-pro-256k", + "Doubao-lite-128k", + "Doubao-lite-32k", + "Doubao-vision-lite-32k", + "Doubao-vision-pro-32k", + "Doubao-1.5-pro-vision-32k", + "Doubao-1.5-lite-32k", + "Doubao-1.5-pro-32k", + "Doubao-1.5-thinking-pro", + "Doubao-1.5-pro-256k", } var ChannelName = "coze" diff --git a/relay/channel/coze/relay-coze.go b/relay/channel/coze/relay-coze.go index 8e9b8e3e..1ebdb7c1 100644 --- a/relay/channel/coze/relay-coze.go +++ b/relay/channel/coze/relay-coze.go @@ -28,10 +28,13 @@ func convertCozeChatRequest(c *gin.Context, request dto.GeneralOpenAIRequest) *C }) } } + user := request.User + if user == "" { + user = helper.GetResponseID(c) + } cozeRequest := &CozeChatRequest{ - // TODO: model to botid BotId: c.GetString("bot_id"), - UserId: c.GetString("id"), + UserId: user, AdditionalMessages: messages, Stream: request.Stream, } @@ -172,6 +175,6 @@ func doRequest(req *http.Request, info *common.RelayInfo) (*http.Response, error if err != nil { // 增加对 client.Do(req) 返回错误的检查 return nil, fmt.Errorf("client.Do failed: %w", err) } - _ = resp.Body.Close() + // _ = resp.Body.Close() return resp, nil } diff --git a/web/src/constants/channel.constants.js b/web/src/constants/channel.constants.js index fa59bcce..054da535 100644 --- a/web/src/constants/channel.constants.js +++ b/web/src/constants/channel.constants.js @@ -118,6 +118,11 @@ export const CHANNEL_OPTIONS = [ { value: 48, color: 'blue', - label: 'xAI' - } + label: 'xAI', + }, + { + value: 49, + color: 'blue', + label: 'Coze', + }, ]; diff --git a/web/src/pages/Channel/EditChannel.js b/web/src/pages/Channel/EditChannel.js index fd96ffb6..f7fab057 100644 --- a/web/src/pages/Channel/EditChannel.js +++ b/web/src/pages/Channel/EditChannel.js @@ -838,6 +838,22 @@ const EditChannel = (props) => { /> > )} + {inputs.type === 49 && ( + <> +