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
f2e10286
authored
Jul 23, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(adaptor): update relay mode handling #1419
parent
ec0eb57d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
relay/channel/siliconflow/adaptor.go
+6
-3
No files found.
relay/channel/siliconflow/adaptor.go
View file @
f2e10286
...
...
@@ -46,7 +46,7 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) {
}
else
if
info
.
RelayMode
==
constant
.
RelayModeCompletions
{
return
fmt
.
Sprintf
(
"%s/v1/completions"
,
info
.
BaseUrl
),
nil
}
return
""
,
errors
.
New
(
"invalid relay mode"
)
return
fmt
.
Sprintf
(
"%s/v1/chat/completions"
,
info
.
BaseUrl
),
nil
}
func
(
a
*
Adaptor
)
SetupRequestHeader
(
c
*
gin
.
Context
,
req
*
http
.
Header
,
info
*
relaycommon
.
RelayInfo
)
error
{
...
...
@@ -80,16 +80,19 @@ func (a *Adaptor) DoResponse(c *gin.Context, resp *http.Response, info *relaycom
switch
info
.
RelayMode
{
case
constant
.
RelayModeRerank
:
usage
,
err
=
siliconflowRerankHandler
(
c
,
info
,
resp
)
case
constant
.
RelayModeEmbeddings
:
usage
,
err
=
openai
.
OpenaiHandler
(
c
,
info
,
resp
)
case
constant
.
RelayModeCompletions
:
fallthrough
case
constant
.
RelayModeChatCompletions
:
fallthrough
default
:
if
info
.
IsStream
{
usage
,
err
=
openai
.
OaiStreamHandler
(
c
,
info
,
resp
)
}
else
{
usage
,
err
=
openai
.
OpenaiHandler
(
c
,
info
,
resp
)
}
case
constant
.
RelayModeEmbeddings
:
usage
,
err
=
openai
.
OpenaiHandler
(
c
,
info
,
resp
)
}
return
}
...
...
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