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
ec4d2de4
authored
Sep 18, 2025
by
Calcium-Ion
Committed by
GitHub
Sep 18, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1832 from seefs001/feature/deepseek-claude-code
feat: deepseek claude endpoint
parents
a1b5ae8b
06ccdcba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
relay/channel/deepseek/adaptor.go
+8
-3
No files found.
relay/channel/deepseek/adaptor.go
View file @
ec4d2de4
...
...
@@ -3,17 +3,17 @@ package deepseek
import
(
"errors"
"fmt"
"github.com/gin-gonic/gin"
"io"
"net/http"
"one-api/dto"
"one-api/relay/channel"
"one-api/relay/channel/claude"
"one-api/relay/channel/openai"
relaycommon
"one-api/relay/common"
"one-api/relay/constant"
"one-api/types"
"strings"
"github.com/gin-gonic/gin"
)
type
Adaptor
struct
{
...
...
@@ -25,7 +25,7 @@ func (a *Adaptor) ConvertGeminiRequest(*gin.Context, *relaycommon.RelayInfo, *dt
}
func
(
a
*
Adaptor
)
ConvertClaudeRequest
(
c
*
gin
.
Context
,
info
*
relaycommon
.
RelayInfo
,
req
*
dto
.
ClaudeRequest
)
(
any
,
error
)
{
adaptor
:=
openai
.
Adaptor
{}
adaptor
:=
claude
.
Adaptor
{}
return
adaptor
.
ConvertClaudeRequest
(
c
,
info
,
req
)
}
...
...
@@ -44,6 +44,10 @@ func (a *Adaptor) Init(info *relaycommon.RelayInfo) {
func
(
a
*
Adaptor
)
GetRequestURL
(
info
*
relaycommon
.
RelayInfo
)
(
string
,
error
)
{
fimBaseUrl
:=
info
.
ChannelBaseUrl
switch
info
.
RelayFormat
{
case
types
.
RelayFormatClaude
:
return
fmt
.
Sprintf
(
"%s/anthropic/v1/messages"
,
info
.
ChannelBaseUrl
),
nil
default
:
if
!
strings
.
HasSuffix
(
info
.
ChannelBaseUrl
,
"/beta"
)
{
fimBaseUrl
+=
"/beta"
}
...
...
@@ -53,6 +57,7 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) {
default
:
return
fmt
.
Sprintf
(
"%s/v1/chat/completions"
,
info
.
ChannelBaseUrl
),
nil
}
}
}
func
(
a
*
Adaptor
)
SetupRequestHeader
(
c
*
gin
.
Context
,
req
*
http
.
Header
,
info
*
relaycommon
.
RelayInfo
)
error
{
...
...
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