fix(ai-proxy): ensure basePathHandling works with original protocol (#3225)

This commit is contained in:
woody
2025-12-16 20:49:21 +08:00
committed by GitHub
parent 3cc745a6f5
commit 6998800c64
6 changed files with 555 additions and 5 deletions

View File

@@ -106,8 +106,11 @@ func (m *minimaxProvider) handleRequestBodyByChatCompletionPro(body []byte) (typ
}
// Map the model and rewrite the request path.
// When using original protocol, don't overwrite the path to ensure basePathHandling works correctly.
request.Model = getMappedModel(request.Model, m.config.modelMapping)
_ = util.OverwriteRequestPath(fmt.Sprintf("%s?GroupId=%s", minimaxChatCompletionProPath, m.config.minimaxGroupId))
if !m.config.IsOriginal() {
_ = util.OverwriteRequestPath(fmt.Sprintf("%s?GroupId=%s", minimaxChatCompletionProPath, m.config.minimaxGroupId))
}
if m.config.context == nil {
minimaxRequest := m.buildMinimaxChatCompletionProRequest(request, "")