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
f09e86de
authored
May 16, 2024
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: pre to delete custom channel type
parent
a127461b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
relay/constant/api_type.go
+2
-2
relay/relay_adaptor.go
+1
-1
web/src/components/ChannelsTable.js
+7
-0
No files found.
relay/constant/api_type.go
View file @
f09e86de
...
...
@@ -15,7 +15,7 @@ const (
APITypeAIProxyLibrary
APITypeTencent
APITypeGemini
APITypeZhipu
_v
4
APITypeZhipu
V
4
APITypeOllama
APITypePerplexity
APITypeAws
...
...
@@ -48,7 +48,7 @@ func ChannelType2APIType(channelType int) (int, bool) {
case
common
.
ChannelTypeGemini
:
apiType
=
APITypeGemini
case
common
.
ChannelTypeZhipu_v4
:
apiType
=
APITypeZhipu
_v
4
apiType
=
APITypeZhipu
V
4
case
common
.
ChannelTypeOllama
:
apiType
=
APITypeOllama
case
common
.
ChannelTypePerplexity
:
...
...
relay/relay_adaptor.go
View file @
f09e86de
...
...
@@ -41,7 +41,7 @@ func GetAdaptor(apiType int) channel.Adaptor {
return
&
xunfei
.
Adaptor
{}
case
constant
.
APITypeZhipu
:
return
&
zhipu
.
Adaptor
{}
case
constant
.
APITypeZhipu
_v
4
:
case
constant
.
APITypeZhipu
V
4
:
return
&
zhipu_4v
.
Adaptor
{}
case
constant
.
APITypeOllama
:
return
&
ollama
.
Adaptor
{}
...
...
web/src/components/ChannelsTable.js
View file @
f09e86de
...
...
@@ -6,6 +6,7 @@ import {
showError
,
showInfo
,
showSuccess
,
showWarning
,
timestamp2string
,
}
from
'../helpers'
;
...
...
@@ -309,6 +310,12 @@ const ChannelsTable = () => {
const
setChannelFormat
=
(
channels
)
=>
{
for
(
let
i
=
0
;
i
<
channels
.
length
;
i
++
)
{
if
(
channels
[
i
].
type
===
8
)
{
showWarning
(
'检测到您使用了“自定义渠道”类型,请更换为“OpenAI”渠道类型!'
,
);
showWarning
(
'下个版本将不再支持“自定义渠道”类型!'
);
}
channels
[
i
].
key
=
''
+
channels
[
i
].
id
;
let
test_models
=
[];
channels
[
i
].
models
.
split
(
','
).
forEach
((
item
,
index
)
=>
{
...
...
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