mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-13 03:43:44 +08:00
chore: reorganize constant related package
This commit is contained in:
39
relay/channeltype/define.go
Normal file
39
relay/channeltype/define.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package channeltype
|
||||
|
||||
const (
|
||||
Unknown = iota
|
||||
OpenAI
|
||||
API2D
|
||||
Azure
|
||||
CloseAI
|
||||
OpenAISB
|
||||
OpenAIMax
|
||||
OhMyGPT
|
||||
Custom
|
||||
Ails
|
||||
AIProxy
|
||||
PaLM
|
||||
API2GPT
|
||||
AIGC2D
|
||||
Anthropic
|
||||
Baidu
|
||||
Zhipu
|
||||
Ali
|
||||
Xunfei
|
||||
AI360
|
||||
OpenRouter
|
||||
AIProxyLibrary
|
||||
FastGPT
|
||||
Tencent
|
||||
Gemini
|
||||
Moonshot
|
||||
Baichuan
|
||||
Minimax
|
||||
Mistral
|
||||
Groq
|
||||
Ollama
|
||||
LingYiWanWu
|
||||
StepFun
|
||||
|
||||
Dummy
|
||||
)
|
||||
30
relay/channeltype/helper.go
Normal file
30
relay/channeltype/helper.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package channeltype
|
||||
|
||||
import "github.com/songquanpeng/one-api/relay/apitype"
|
||||
|
||||
func ToAPIType(channelType int) int {
|
||||
apiType := apitype.OpenAI
|
||||
switch channelType {
|
||||
case Anthropic:
|
||||
apiType = apitype.Anthropic
|
||||
case Baidu:
|
||||
apiType = apitype.Baidu
|
||||
case PaLM:
|
||||
apiType = apitype.PaLM
|
||||
case Zhipu:
|
||||
apiType = apitype.Zhipu
|
||||
case Ali:
|
||||
apiType = apitype.Ali
|
||||
case Xunfei:
|
||||
apiType = apitype.Xunfei
|
||||
case AIProxyLibrary:
|
||||
apiType = apitype.AIProxyLibrary
|
||||
case Tencent:
|
||||
apiType = apitype.Tencent
|
||||
case Gemini:
|
||||
apiType = apitype.Gemini
|
||||
case Ollama:
|
||||
apiType = apitype.Ollama
|
||||
}
|
||||
return apiType
|
||||
}
|
||||
Reference in New Issue
Block a user