MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / ChannelType2APIType

Function ChannelType2APIType

common/api_type.go:5–73  ·  view source on GitHub ↗
(channelType int)

Source from the content-addressed store, hash-verified

3import "one-api/constant"
4
5func ChannelType2APIType(channelType int) (int, bool) {
6 apiType := -1
7 switch channelType {
8 case constant.ChannelTypeOpenAI:
9 apiType = constant.APITypeOpenAI
10 case constant.ChannelTypeAnthropic:
11 apiType = constant.APITypeAnthropic
12 case constant.ChannelTypeBaidu:
13 apiType = constant.APITypeBaidu
14 case constant.ChannelTypePaLM:
15 apiType = constant.APITypePaLM
16 case constant.ChannelTypeZhipu:
17 apiType = constant.APITypeZhipu
18 case constant.ChannelTypeAli:
19 apiType = constant.APITypeAli
20 case constant.ChannelTypeXunfei:
21 apiType = constant.APITypeXunfei
22 case constant.ChannelTypeAIProxyLibrary:
23 apiType = constant.APITypeAIProxyLibrary
24 case constant.ChannelTypeTencent:
25 apiType = constant.APITypeTencent
26 case constant.ChannelTypeGemini:
27 apiType = constant.APITypeGemini
28 case constant.ChannelTypeZhipu_v4:
29 apiType = constant.APITypeZhipuV4
30 case constant.ChannelTypeOllama:
31 apiType = constant.APITypeOllama
32 case constant.ChannelTypePerplexity:
33 apiType = constant.APITypePerplexity
34 case constant.ChannelTypeAws:
35 apiType = constant.APITypeAws
36 case constant.ChannelTypeCohere:
37 apiType = constant.APITypeCohere
38 case constant.ChannelTypeDify:
39 apiType = constant.APITypeDify
40 case constant.ChannelTypeJina:
41 apiType = constant.APITypeJina
42 case constant.ChannelCloudflare:
43 apiType = constant.APITypeCloudflare
44 case constant.ChannelTypeSiliconFlow:
45 apiType = constant.APITypeSiliconFlow
46 case constant.ChannelTypeVertexAi:
47 apiType = constant.APITypeVertexAi
48 case constant.ChannelTypeMistral:
49 apiType = constant.APITypeMistral
50 case constant.ChannelTypeDeepSeek:
51 apiType = constant.APITypeDeepSeek
52 case constant.ChannelTypeMokaAI:
53 apiType = constant.APITypeMokaAI
54 case constant.ChannelTypeVolcEngine:
55 apiType = constant.APITypeVolcEngine
56 case constant.ChannelTypeBaiduV2:
57 apiType = constant.APITypeBaiduV2
58 case constant.ChannelTypeOpenRouter:
59 apiType = constant.APITypeOpenRouter
60 case constant.ChannelTypeXinference:
61 apiType = constant.APITypeXinference
62 case constant.ChannelTypeXai:

Callers 1

GenRelayInfoFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected