Merge remote-tracking branch 'origin/alpha' into alpha
This commit is contained in:
@@ -2,6 +2,7 @@ package volcengine
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
@@ -214,6 +215,12 @@ func (a *Adaptor) ConvertOpenAIRequest(c *gin.Context, info *relaycommon.RelayIn
|
|||||||
if request == nil {
|
if request == nil {
|
||||||
return nil, errors.New("request is 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
|
return request, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -248,9 +248,10 @@ func StreamResponseOpenAI2Claude(openAIResponse *dto.ChatCompletionsStreamRespon
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
claudeResponses = append(claudeResponses, &dto.ClaudeResponse{
|
claudeResponses = append(claudeResponses, &dto.ClaudeResponse{
|
||||||
Type: "content_block_delta",
|
Index: &info.ClaudeConvertInfo.Index,
|
||||||
|
Type: "content_block_delta",
|
||||||
Delta: &dto.ClaudeMediaMessage{
|
Delta: &dto.ClaudeMediaMessage{
|
||||||
Type: "text",
|
Type: "text_delta",
|
||||||
Text: common.GetPointer[string](openAIResponse.Choices[0].Delta.GetContentString()),
|
Text: common.GetPointer[string](openAIResponse.Choices[0].Delta.GetContentString()),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user