From 3b26810c17bd2d8d57ce28c2d41c2333f00a16e5 Mon Sep 17 00:00:00 2001 From: wzxjohn Date: Wed, 13 Aug 2025 09:57:06 +0800 Subject: [PATCH 1/2] fix(adaptor): missing first text delta while convert OpenAI to Claude --- service/convert.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/service/convert.go b/service/convert.go index ea219c4fa..b232ca396 100644 --- a/service/convert.go +++ b/service/convert.go @@ -248,9 +248,10 @@ func StreamResponseOpenAI2Claude(openAIResponse *dto.ChatCompletionsStreamRespon }, }) claudeResponses = append(claudeResponses, &dto.ClaudeResponse{ - Type: "content_block_delta", + Index: &info.ClaudeConvertInfo.Index, + Type: "content_block_delta", Delta: &dto.ClaudeMediaMessage{ - Type: "text", + Type: "text_delta", Text: common.GetPointer[string](openAIResponse.Choices[0].Delta.GetContentString()), }, }) From ee6dd9179ba0d50a5a3351d061dc184853cfcbbc Mon Sep 17 00:00:00 2001 From: HynoR <20227709+HynoR@users.noreply.github.com> Date: Mon, 25 Aug 2025 10:35:31 +0800 Subject: [PATCH 2/2] feat: adapt Volcengine adaptor for deepseek3.1 model with thinking suffix --- relay/channel/volcengine/adaptor.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/relay/channel/volcengine/adaptor.go b/relay/channel/volcengine/adaptor.go index b46cb9525..0af019da4 100644 --- a/relay/channel/volcengine/adaptor.go +++ b/relay/channel/volcengine/adaptor.go @@ -2,6 +2,7 @@ package volcengine import ( "bytes" + "encoding/json" "errors" "fmt" "io" @@ -214,6 +215,12 @@ func (a *Adaptor) ConvertOpenAIRequest(c *gin.Context, info *relaycommon.RelayIn if request == nil { return nil, errors.New("request is nil") } + // 适配 方舟deepseek混合模型 的 thinking 后缀 + if strings.HasSuffix(info.UpstreamModelName, "-thinking") && strings.HasPrefix(info.UpstreamModelName, "deepseek") { + info.UpstreamModelName = strings.TrimSuffix(info.UpstreamModelName, "-thinking") + request.Model = info.UpstreamModelName + request.THINKING = json.RawMessage(`{"type": "enabled"}`) + } return request, nil }