Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

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