From 108b67be6cc269778c17e24d38b5bc1971d11919 Mon Sep 17 00:00:00 2001 From: creamlike1024 Date: Tue, 13 May 2025 22:23:38 +0800 Subject: [PATCH] use channel bot id --- middleware/distributor.go | 2 ++ relay/channel/coze/relay-coze.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/middleware/distributor.go b/middleware/distributor.go index 34882381..fdda8dda 100644 --- a/middleware/distributor.go +++ b/middleware/distributor.go @@ -240,5 +240,7 @@ func SetupContextForSelectedChannel(c *gin.Context, channel *model.Channel, mode c.Set("api_version", channel.Other) case common.ChannelTypeMokaAI: c.Set("api_version", channel.Other) + case common.ChannelTypeCoze: + c.Set("bot_id", channel.Other) } } diff --git a/relay/channel/coze/relay-coze.go b/relay/channel/coze/relay-coze.go index fe630ef6..8e9b8e3e 100644 --- a/relay/channel/coze/relay-coze.go +++ b/relay/channel/coze/relay-coze.go @@ -30,7 +30,7 @@ func convertCozeChatRequest(c *gin.Context, request dto.GeneralOpenAIRequest) *C } cozeRequest := &CozeChatRequest{ // TODO: model to botid - BotId: "1", + BotId: c.GetString("bot_id"), UserId: c.GetString("id"), AdditionalMessages: messages, Stream: request.Stream,