Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
50ed5529
authored
Feb 17, 2026
by
Seefs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: minimax native /v1/messages
parent
d45cd9af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
10 deletions
+23
-10
relay/channel/minimax/adaptor.go
+11
-3
relay/channel/minimax/relay-minimax.go
+12
-7
No files found.
relay/channel/minimax/adaptor.go
View file @
50ed5529
...
@@ -10,6 +10,7 @@ import (
...
@@ -10,6 +10,7 @@ import (
"github.com/QuantumNous/new-api/dto"
"github.com/QuantumNous/new-api/dto"
"github.com/QuantumNous/new-api/relay/channel"
"github.com/QuantumNous/new-api/relay/channel"
"github.com/QuantumNous/new-api/relay/channel/claude"
"github.com/QuantumNous/new-api/relay/channel/openai"
"github.com/QuantumNous/new-api/relay/channel/openai"
relaycommon
"github.com/QuantumNous/new-api/relay/common"
relaycommon
"github.com/QuantumNous/new-api/relay/common"
"github.com/QuantumNous/new-api/relay/constant"
"github.com/QuantumNous/new-api/relay/constant"
...
@@ -26,7 +27,8 @@ func (a *Adaptor) ConvertGeminiRequest(*gin.Context, *relaycommon.RelayInfo, *dt
...
@@ -26,7 +27,8 @@ func (a *Adaptor) ConvertGeminiRequest(*gin.Context, *relaycommon.RelayInfo, *dt
}
}
func
(
a
*
Adaptor
)
ConvertClaudeRequest
(
c
*
gin
.
Context
,
info
*
relaycommon
.
RelayInfo
,
req
*
dto
.
ClaudeRequest
)
(
any
,
error
)
{
func
(
a
*
Adaptor
)
ConvertClaudeRequest
(
c
*
gin
.
Context
,
info
*
relaycommon
.
RelayInfo
,
req
*
dto
.
ClaudeRequest
)
(
any
,
error
)
{
return
nil
,
errors
.
New
(
"not implemented"
)
adaptor
:=
claude
.
Adaptor
{}
return
adaptor
.
ConvertClaudeRequest
(
c
,
info
,
req
)
}
}
func
(
a
*
Adaptor
)
ConvertAudioRequest
(
c
*
gin
.
Context
,
info
*
relaycommon
.
RelayInfo
,
request
dto
.
AudioRequest
)
(
io
.
Reader
,
error
)
{
func
(
a
*
Adaptor
)
ConvertAudioRequest
(
c
*
gin
.
Context
,
info
*
relaycommon
.
RelayInfo
,
request
dto
.
AudioRequest
)
(
io
.
Reader
,
error
)
{
...
@@ -119,8 +121,14 @@ func (a *Adaptor) DoResponse(c *gin.Context, resp *http.Response, info *relaycom
...
@@ -119,8 +121,14 @@ func (a *Adaptor) DoResponse(c *gin.Context, resp *http.Response, info *relaycom
return
handleTTSResponse
(
c
,
resp
,
info
)
return
handleTTSResponse
(
c
,
resp
,
info
)
}
}
adaptor
:=
openai
.
Adaptor
{}
switch
info
.
RelayFormat
{
return
adaptor
.
DoResponse
(
c
,
resp
,
info
)
case
types
.
RelayFormatClaude
:
adaptor
:=
claude
.
Adaptor
{}
return
adaptor
.
DoResponse
(
c
,
resp
,
info
)
default
:
adaptor
:=
openai
.
Adaptor
{}
return
adaptor
.
DoResponse
(
c
,
resp
,
info
)
}
}
}
func
(
a
*
Adaptor
)
GetModelList
()
[]
string
{
func
(
a
*
Adaptor
)
GetModelList
()
[]
string
{
...
...
relay/channel/minimax/relay-minimax.go
View file @
50ed5529
...
@@ -6,6 +6,7 @@ import (
...
@@ -6,6 +6,7 @@ import (
channelconstant
"github.com/QuantumNous/new-api/constant"
channelconstant
"github.com/QuantumNous/new-api/constant"
relaycommon
"github.com/QuantumNous/new-api/relay/common"
relaycommon
"github.com/QuantumNous/new-api/relay/common"
"github.com/QuantumNous/new-api/relay/constant"
"github.com/QuantumNous/new-api/relay/constant"
"github.com/QuantumNous/new-api/types"
)
)
func
GetRequestURL
(
info
*
relaycommon
.
RelayInfo
)
(
string
,
error
)
{
func
GetRequestURL
(
info
*
relaycommon
.
RelayInfo
)
(
string
,
error
)
{
...
@@ -13,13 +14,17 @@ func GetRequestURL(info *relaycommon.RelayInfo) (string, error) {
...
@@ -13,13 +14,17 @@ func GetRequestURL(info *relaycommon.RelayInfo) (string, error) {
if
baseUrl
==
""
{
if
baseUrl
==
""
{
baseUrl
=
channelconstant
.
ChannelBaseURLs
[
channelconstant
.
ChannelTypeMiniMax
]
baseUrl
=
channelconstant
.
ChannelBaseURLs
[
channelconstant
.
ChannelTypeMiniMax
]
}
}
switch
info
.
RelayFormat
{
switch
info
.
RelayMode
{
case
types
.
RelayFormatClaude
:
case
constant
.
RelayModeChatCompletions
:
return
fmt
.
Sprintf
(
"%s/anthropic/v1/messages"
,
info
.
ChannelBaseUrl
),
nil
return
fmt
.
Sprintf
(
"%s/v1/text/chatcompletion_v2"
,
baseUrl
),
nil
case
constant
.
RelayModeAudioSpeech
:
return
fmt
.
Sprintf
(
"%s/v1/t2a_v2"
,
baseUrl
),
nil
default
:
default
:
return
""
,
fmt
.
Errorf
(
"unsupported relay mode: %d"
,
info
.
RelayMode
)
switch
info
.
RelayMode
{
case
constant
.
RelayModeChatCompletions
:
return
fmt
.
Sprintf
(
"%s/v1/text/chatcompletion_v2"
,
baseUrl
),
nil
case
constant
.
RelayModeAudioSpeech
:
return
fmt
.
Sprintf
(
"%s/v1/t2a_v2"
,
baseUrl
),
nil
default
:
return
""
,
fmt
.
Errorf
(
"unsupported relay mode: %d"
,
info
.
RelayMode
)
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment