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
af2389ca
authored
Mar 18, 2024
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: api type error
parent
62672090
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
relay/constant/api_type.go
+3
-0
relay/relay_adaptor.go
+6
-0
No files found.
relay/constant/api_type.go
View file @
af2389ca
...
@@ -16,6 +16,7 @@ const (
...
@@ -16,6 +16,7 @@ const (
APITypeTencent
APITypeTencent
APITypeGemini
APITypeGemini
APITypeZhipu_v4
APITypeZhipu_v4
APITypeOllama
APITypePerplexity
APITypePerplexity
APITypeDummy
// this one is only for count, do not add any channel after this
APITypeDummy
// this one is only for count, do not add any channel after this
...
@@ -44,6 +45,8 @@ func ChannelType2APIType(channelType int) int {
...
@@ -44,6 +45,8 @@ func ChannelType2APIType(channelType int) int {
apiType
=
APITypeGemini
apiType
=
APITypeGemini
case
common
.
ChannelTypeZhipu_v4
:
case
common
.
ChannelTypeZhipu_v4
:
apiType
=
APITypeZhipu_v4
apiType
=
APITypeZhipu_v4
case
common
.
ChannelTypeOllama
:
apiType
=
APITypeOllama
case
common
.
ChannelTypePerplexity
:
case
common
.
ChannelTypePerplexity
:
apiType
=
APITypePerplexity
apiType
=
APITypePerplexity
}
}
...
...
relay/relay_adaptor.go
View file @
af2389ca
...
@@ -6,8 +6,10 @@ import (
...
@@ -6,8 +6,10 @@ import (
"one-api/relay/channel/baidu"
"one-api/relay/channel/baidu"
"one-api/relay/channel/claude"
"one-api/relay/channel/claude"
"one-api/relay/channel/gemini"
"one-api/relay/channel/gemini"
"one-api/relay/channel/ollama"
"one-api/relay/channel/openai"
"one-api/relay/channel/openai"
"one-api/relay/channel/palm"
"one-api/relay/channel/palm"
"one-api/relay/channel/perplexity"
"one-api/relay/channel/tencent"
"one-api/relay/channel/tencent"
"one-api/relay/channel/xunfei"
"one-api/relay/channel/xunfei"
"one-api/relay/channel/zhipu"
"one-api/relay/channel/zhipu"
...
@@ -39,6 +41,10 @@ func GetAdaptor(apiType int) channel.Adaptor {
...
@@ -39,6 +41,10 @@ func GetAdaptor(apiType int) channel.Adaptor {
return
&
zhipu
.
Adaptor
{}
return
&
zhipu
.
Adaptor
{}
case
constant
.
APITypeZhipu_v4
:
case
constant
.
APITypeZhipu_v4
:
return
&
zhipu_4v
.
Adaptor
{}
return
&
zhipu_4v
.
Adaptor
{}
case
constant
.
APITypeOllama
:
return
&
ollama
.
Adaptor
{}
case
constant
.
APITypePerplexity
:
return
&
perplexity
.
Adaptor
{}
}
}
return
nil
return
nil
}
}
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