Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

219 wiersze
9.7 KiB

  1. package constant
  2. const (
  3. ChannelTypeUnknown = 0
  4. ChannelTypeOpenAI = 1
  5. ChannelTypeMidjourney = 2
  6. ChannelTypeAzure = 3
  7. ChannelTypeOllama = 4
  8. ChannelTypeMidjourneyPlus = 5
  9. ChannelTypeOpenAIMax = 6
  10. ChannelTypeOhMyGPT = 7
  11. ChannelTypeCustom = 8
  12. ChannelTypeAILS = 9
  13. ChannelTypeAIProxy = 10
  14. ChannelTypePaLM = 11
  15. ChannelTypeAPI2GPT = 12
  16. ChannelTypeAIGC2D = 13
  17. ChannelTypeAnthropic = 14
  18. ChannelTypeBaidu = 15
  19. ChannelTypeZhipu = 16
  20. ChannelTypeAli = 17
  21. ChannelTypeXunfei = 18
  22. ChannelType360 = 19
  23. ChannelTypeOpenRouter = 20
  24. ChannelTypeAIProxyLibrary = 21
  25. ChannelTypeFastGPT = 22
  26. ChannelTypeTencent = 23
  27. ChannelTypeGemini = 24
  28. ChannelTypeMoonshot = 25
  29. ChannelTypeZhipu_v4 = 26
  30. ChannelTypePerplexity = 27
  31. ChannelTypeLingYiWanWu = 31
  32. ChannelTypeAws = 33
  33. ChannelTypeCohere = 34
  34. ChannelTypeMiniMax = 35
  35. ChannelTypeSunoAPI = 36
  36. ChannelTypeDify = 37
  37. ChannelTypeJina = 38
  38. ChannelCloudflare = 39
  39. ChannelTypeSiliconFlow = 40
  40. ChannelTypeVertexAi = 41
  41. ChannelTypeMistral = 42
  42. ChannelTypeDeepSeek = 43
  43. ChannelTypeMokaAI = 44
  44. ChannelTypeVolcEngine = 45
  45. ChannelTypeBaiduV2 = 46
  46. ChannelTypeXinference = 47
  47. ChannelTypeXai = 48
  48. ChannelTypeCoze = 49
  49. ChannelTypeKling = 50
  50. ChannelTypeJimeng = 51
  51. ChannelTypeVidu = 52
  52. ChannelTypeSubmodel = 53
  53. ChannelTypeDoubaoVideo = 54
  54. ChannelTypeSora = 55
  55. ChannelTypeReplicate = 56
  56. ChannelTypeCodex = 57
  57. ChannelTypeDoubaoVideoCompatibleAiping = 58
  58. ChannelTypeKlingAiping = 59
  59. ChannelTypeDoubaoVideoCompatibleTianyiYun = 60
  60. ChannelTypeDummy // this one is only for count, do not add any channel after this
  61. )
  62. var ChannelBaseURLs = []string{
  63. "", // 0
  64. "https://api.openai.com", // 1
  65. "https://oa.api2d.net", // 2
  66. "", // 3
  67. "http://localhost:11434", // 4
  68. "https://api.openai-sb.com", // 5
  69. "https://api.openaimax.com", // 6
  70. "https://api.ohmygpt.com", // 7
  71. "", // 8
  72. "https://api.caipacity.com", // 9
  73. "https://api.aiproxy.io", // 10
  74. "", // 11
  75. "https://api.api2gpt.com", // 12
  76. "https://api.aigc2d.com", // 13
  77. "https://api.anthropic.com", // 14
  78. "https://aip.baidubce.com", // 15
  79. "https://open.bigmodel.cn", // 16
  80. "https://dashscope.aliyuncs.com", // 17
  81. "", // 18
  82. "https://api.360.cn", // 19
  83. "https://openrouter.ai/api", // 20
  84. "https://api.aiproxy.io", // 21
  85. "https://fastgpt.run/api/openapi", // 22
  86. "https://hunyuan.tencentcloudapi.com", //23
  87. "https://generativelanguage.googleapis.com", //24
  88. "https://api.moonshot.cn", //25
  89. "https://open.bigmodel.cn", //26
  90. "https://api.perplexity.ai", //27
  91. "", //28
  92. "", //29
  93. "", //30
  94. "https://api.lingyiwanwu.com", //31
  95. "", //32
  96. "", //33
  97. "https://api.cohere.ai", //34
  98. "https://api.minimax.chat", //35
  99. "", //36
  100. "https://api.dify.ai", //37
  101. "https://api.jina.ai", //38
  102. "https://api.cloudflare.com", //39
  103. "https://api.siliconflow.cn", //40
  104. "", //41
  105. "https://api.mistral.ai", //42
  106. "https://api.deepseek.com", //43
  107. "https://api.moka.ai", //44
  108. "https://ark.cn-beijing.volces.com", //45
  109. "https://qianfan.baidubce.com", //46
  110. "", //47
  111. "https://api.x.ai", //48
  112. "https://api.coze.cn", //49
  113. "https://api.klingai.com", //50
  114. "https://visual.volcengineapi.com", //51
  115. "https://api.vidu.cn", //52
  116. "https://llm.submodel.ai", //53
  117. "https://ark.cn-beijing.volces.com", //54
  118. "https://api.openai.com", //55
  119. "https://api.replicate.com", //56
  120. "https://chatgpt.com", //57
  121. "", //58
  122. "https://aiping.cn/api", //59
  123. "https://ai.ctaigw.cn", //60
  124. }
  125. var ChannelTypeNames = map[int]string{
  126. ChannelTypeUnknown: "Unknown",
  127. ChannelTypeOpenAI: "OpenAI",
  128. ChannelTypeMidjourney: "Midjourney",
  129. ChannelTypeAzure: "Azure",
  130. ChannelTypeOllama: "Ollama",
  131. ChannelTypeMidjourneyPlus: "MidjourneyPlus",
  132. ChannelTypeOpenAIMax: "OpenAIMax",
  133. ChannelTypeOhMyGPT: "OhMyGPT",
  134. ChannelTypeCustom: "Custom",
  135. ChannelTypeAILS: "AILS",
  136. ChannelTypeAIProxy: "AIProxy",
  137. ChannelTypePaLM: "PaLM",
  138. ChannelTypeAPI2GPT: "API2GPT",
  139. ChannelTypeAIGC2D: "AIGC2D",
  140. ChannelTypeAnthropic: "Anthropic",
  141. ChannelTypeBaidu: "Baidu",
  142. ChannelTypeZhipu: "Zhipu",
  143. ChannelTypeAli: "Ali",
  144. ChannelTypeXunfei: "Xunfei",
  145. ChannelType360: "360",
  146. ChannelTypeOpenRouter: "OpenRouter",
  147. ChannelTypeAIProxyLibrary: "AIProxyLibrary",
  148. ChannelTypeFastGPT: "FastGPT",
  149. ChannelTypeTencent: "Tencent",
  150. ChannelTypeGemini: "Gemini",
  151. ChannelTypeMoonshot: "Moonshot",
  152. ChannelTypeZhipu_v4: "ZhipuV4",
  153. ChannelTypePerplexity: "Perplexity",
  154. ChannelTypeLingYiWanWu: "LingYiWanWu",
  155. ChannelTypeAws: "AWS",
  156. ChannelTypeCohere: "Cohere",
  157. ChannelTypeMiniMax: "MiniMax",
  158. ChannelTypeSunoAPI: "SunoAPI",
  159. ChannelTypeDify: "Dify",
  160. ChannelTypeJina: "Jina",
  161. ChannelCloudflare: "Cloudflare",
  162. ChannelTypeSiliconFlow: "SiliconFlow",
  163. ChannelTypeVertexAi: "VertexAI",
  164. ChannelTypeMistral: "Mistral",
  165. ChannelTypeDeepSeek: "DeepSeek",
  166. ChannelTypeMokaAI: "MokaAI",
  167. ChannelTypeVolcEngine: "VolcEngine",
  168. ChannelTypeBaiduV2: "BaiduV2",
  169. ChannelTypeXinference: "Xinference",
  170. ChannelTypeXai: "xAI",
  171. ChannelTypeCoze: "Coze",
  172. ChannelTypeKling: "Kling",
  173. ChannelTypeJimeng: "Jimeng",
  174. ChannelTypeVidu: "Vidu",
  175. ChannelTypeSubmodel: "Submodel",
  176. ChannelTypeDoubaoVideo: "DoubaoVideo",
  177. ChannelTypeSora: "Sora",
  178. ChannelTypeReplicate: "Replicate",
  179. ChannelTypeCodex: "Codex",
  180. ChannelTypeDoubaoVideoCompatibleAiping: "DoubaoVideoCompatibleAiping",
  181. ChannelTypeKlingAiping: "KlingAiping",
  182. ChannelTypeDoubaoVideoCompatibleTianyiYun: "DoubaoVideoCompatibleTianyiYun",
  183. }
  184. func GetChannelTypeName(channelType int) string {
  185. if name, ok := ChannelTypeNames[channelType]; ok {
  186. return name
  187. }
  188. return "Unknown"
  189. }
  190. type ChannelSpecialBase struct {
  191. ClaudeBaseURL string
  192. OpenAIBaseURL string
  193. }
  194. var ChannelSpecialBases = map[string]ChannelSpecialBase{
  195. "glm-coding-plan": {
  196. ClaudeBaseURL: "https://open.bigmodel.cn/api/anthropic",
  197. OpenAIBaseURL: "https://open.bigmodel.cn/api/coding/paas/v4",
  198. },
  199. "glm-coding-plan-international": {
  200. ClaudeBaseURL: "https://api.z.ai/api/anthropic",
  201. OpenAIBaseURL: "https://api.z.ai/api/coding/paas/v4",
  202. },
  203. "kimi-coding-plan": {
  204. ClaudeBaseURL: "https://api.kimi.com/coding",
  205. OpenAIBaseURL: "https://api.kimi.com/coding/v1",
  206. },
  207. "doubao-coding-plan": {
  208. ClaudeBaseURL: "https://ark.cn-beijing.volces.com/api/coding",
  209. OpenAIBaseURL: "https://ark.cn-beijing.volces.com/api/coding/v3",
  210. },
  211. }