constant.ts 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764
  1. export const OWNER = "ChatGPTNextWeb";
  2. export const REPO = "ChatGPT-Next-Web";
  3. export const REPO_URL = `https://github.com/${OWNER}/${REPO}`;
  4. export const PLUGINS_REPO_URL = `https://github.com/${OWNER}/NextChat-Awesome-Plugins`;
  5. export const ISSUE_URL = `https://github.com/${OWNER}/${REPO}/issues`;
  6. export const UPDATE_URL = `${REPO_URL}#keep-updated`;
  7. export const RELEASE_URL = `${REPO_URL}/releases`;
  8. export const FETCH_COMMIT_URL = `https://api.github.com/repos/${OWNER}/${REPO}/commits?per_page=1`;
  9. export const FETCH_TAG_URL = `https://api.github.com/repos/${OWNER}/${REPO}/tags?per_page=1`;
  10. export const RUNTIME_CONFIG_DOM = "danger-runtime-config";
  11. export const STABILITY_BASE_URL = "https://api.stability.ai";
  12. export const OPENAI_BASE_URL = "https://api.openai.com";
  13. export const ANTHROPIC_BASE_URL = "https://api.anthropic.com";
  14. export const GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/";
  15. export const BAIDU_BASE_URL = "https://aip.baidubce.com";
  16. export const BAIDU_OATUH_URL = `${BAIDU_BASE_URL}/oauth/2.0/token`;
  17. export const BYTEDANCE_BASE_URL = "https://ark.cn-beijing.volces.com";
  18. export const ALIBABA_BASE_URL = "https://dashscope.aliyuncs.com/api/";
  19. export const TENCENT_BASE_URL = "https://hunyuan.tencentcloudapi.com";
  20. export const MOONSHOT_BASE_URL = "https://api.moonshot.cn";
  21. export const IFLYTEK_BASE_URL = "https://spark-api-open.xf-yun.com";
  22. export const DEEPSEEK_BASE_URL = "https://api.deepseek.com";
  23. export const XAI_BASE_URL = "https://api.x.ai";
  24. export const CHATGLM_BASE_URL = "https://open.bigmodel.cn";
  25. export const CACHE_URL_PREFIX = "/api/cache";
  26. export const UPLOAD_URL = `${CACHE_URL_PREFIX}/upload`;
  27. export enum Path {
  28. Home = "/",
  29. Chat = "/chat",
  30. Settings = "/settings",
  31. NewChat = "/new-chat",
  32. Masks = "/masks",
  33. Plugins = "/plugins",
  34. Auth = "/auth",
  35. Sd = "/sd",
  36. SdNew = "/sd-new",
  37. Artifacts = "/artifacts",
  38. SearchChat = "/search-chat",
  39. McpMarket = "/mcp-market",
  40. }
  41. export enum ApiPath {
  42. Cors = "",
  43. Azure = "/api/azure",
  44. OpenAI = "/api/openai",
  45. Anthropic = "/api/anthropic",
  46. Google = "/api/google",
  47. Baidu = "/api/baidu",
  48. ByteDance = "/api/bytedance",
  49. Alibaba = "/api/alibaba",
  50. Tencent = "/api/tencent",
  51. Moonshot = "/api/moonshot",
  52. Iflytek = "/api/iflytek",
  53. Stability = "/api/stability",
  54. Artifacts = "/api/artifacts",
  55. XAI = "/api/xai",
  56. ChatGLM = "/api/chatglm",
  57. DeepSeek = "/api/deepseek",
  58. }
  59. export enum SlotID {
  60. AppBody = "app-body",
  61. CustomModel = "custom-model",
  62. }
  63. export enum FileName {
  64. Masks = "masks.json",
  65. Prompts = "prompts.json",
  66. }
  67. export enum StoreKey {
  68. Chat = "chat-next-web-store",
  69. Plugin = "chat-next-web-plugin",
  70. Access = "access-control",
  71. Config = "app-config",
  72. Mask = "mask-store",
  73. Prompt = "prompt-store",
  74. Update = "chat-update",
  75. Sync = "sync",
  76. SdList = "sd-list",
  77. Mcp = "mcp-store",
  78. }
  79. export const DEFAULT_SIDEBAR_WIDTH = 300;
  80. export const MAX_SIDEBAR_WIDTH = 500;
  81. export const MIN_SIDEBAR_WIDTH = 230;
  82. export const NARROW_SIDEBAR_WIDTH = 100;
  83. export const ACCESS_CODE_PREFIX = "nk-";
  84. export const LAST_INPUT_KEY = "last-input";
  85. export const UNFINISHED_INPUT = (id: string) => "unfinished-input-" + id;
  86. export const STORAGE_KEY = "chatgpt-next-web";
  87. export const REQUEST_TIMEOUT_MS = 60000;
  88. export const EXPORT_MESSAGE_CLASS_NAME = "export-markdown";
  89. export enum ServiceProvider {
  90. OpenAI = "OpenAI",
  91. Azure = "Azure",
  92. Google = "Google",
  93. Anthropic = "Anthropic",
  94. Baidu = "Baidu",
  95. ByteDance = "ByteDance",
  96. Alibaba = "Alibaba",
  97. Tencent = "Tencent",
  98. Moonshot = "Moonshot",
  99. Stability = "Stability",
  100. Iflytek = "Iflytek",
  101. XAI = "XAI",
  102. ChatGLM = "ChatGLM",
  103. DeepSeek = "DeepSeek",
  104. }
  105. // Google API safety settings, see https://ai.google.dev/gemini-api/docs/safety-settings
  106. // BLOCK_NONE will not block any content, and BLOCK_ONLY_HIGH will block only high-risk content.
  107. export enum GoogleSafetySettingsThreshold {
  108. BLOCK_NONE = "BLOCK_NONE",
  109. BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH",
  110. BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
  111. BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
  112. }
  113. export enum ModelProvider {
  114. Stability = "Stability",
  115. GPT = "GPT",
  116. GeminiPro = "GeminiPro",
  117. Claude = "Claude",
  118. Ernie = "Ernie",
  119. Doubao = "Doubao",
  120. Qwen = "Qwen",
  121. Hunyuan = "Hunyuan",
  122. Moonshot = "Moonshot",
  123. Iflytek = "Iflytek",
  124. XAI = "XAI",
  125. ChatGLM = "ChatGLM",
  126. DeepSeek = "DeepSeek",
  127. }
  128. export const Stability = {
  129. GeneratePath: "v2beta/stable-image/generate",
  130. ExampleEndpoint: "https://api.stability.ai",
  131. };
  132. export const Anthropic = {
  133. ChatPath: "v1/messages",
  134. ChatPath1: "v1/complete",
  135. ExampleEndpoint: "https://api.anthropic.com",
  136. Vision: "2023-06-01",
  137. };
  138. export const OpenaiPath = {
  139. ChatPath: "v1/chat/completions",
  140. SpeechPath: "v1/audio/speech",
  141. ImagePath: "v1/images/generations",
  142. UsagePath: "dashboard/billing/usage",
  143. SubsPath: "dashboard/billing/subscription",
  144. ListModelPath: "v1/models",
  145. };
  146. export const Azure = {
  147. ChatPath: (deployName: string, apiVersion: string) =>
  148. `deployments/${deployName}/chat/completions?api-version=${apiVersion}`,
  149. // https://<your_resource_name>.openai.azure.com/openai/deployments/<your_deployment_name>/images/generations?api-version=<api_version>
  150. ImagePath: (deployName: string, apiVersion: string) =>
  151. `deployments/${deployName}/images/generations?api-version=${apiVersion}`,
  152. ExampleEndpoint: "https://{resource-url}/openai",
  153. };
  154. export const Google = {
  155. ExampleEndpoint: "https://generativelanguage.googleapis.com/",
  156. ChatPath: (modelName: string) =>
  157. `v1beta/models/${modelName}:streamGenerateContent`,
  158. };
  159. export const Baidu = {
  160. ExampleEndpoint: BAIDU_BASE_URL,
  161. ChatPath: (modelName: string) => {
  162. let endpoint = modelName;
  163. if (modelName === "ernie-4.0-8k") {
  164. endpoint = "completions_pro";
  165. }
  166. if (modelName === "ernie-4.0-8k-preview-0518") {
  167. endpoint = "completions_adv_pro";
  168. }
  169. if (modelName === "ernie-3.5-8k") {
  170. endpoint = "completions";
  171. }
  172. if (modelName === "ernie-speed-8k") {
  173. endpoint = "ernie_speed";
  174. }
  175. return `rpc/2.0/ai_custom/v1/wenxinworkshop/chat/${endpoint}`;
  176. },
  177. };
  178. export const ByteDance = {
  179. ExampleEndpoint: "https://ark.cn-beijing.volces.com/api/",
  180. ChatPath: "api/v3/chat/completions",
  181. };
  182. export const Alibaba = {
  183. ExampleEndpoint: ALIBABA_BASE_URL,
  184. ChatPath: "v1/services/aigc/text-generation/generation",
  185. };
  186. export const Tencent = {
  187. ExampleEndpoint: TENCENT_BASE_URL,
  188. };
  189. export const Moonshot = {
  190. ExampleEndpoint: MOONSHOT_BASE_URL,
  191. ChatPath: "v1/chat/completions",
  192. };
  193. export const Iflytek = {
  194. ExampleEndpoint: IFLYTEK_BASE_URL,
  195. ChatPath: "v1/chat/completions",
  196. };
  197. export const DeepSeek = {
  198. ExampleEndpoint: DEEPSEEK_BASE_URL,
  199. ChatPath: "chat/completions",
  200. };
  201. export const XAI = {
  202. ExampleEndpoint: XAI_BASE_URL,
  203. ChatPath: "v1/chat/completions",
  204. };
  205. export const ChatGLM = {
  206. ExampleEndpoint: CHATGLM_BASE_URL,
  207. ChatPath: "api/paas/v4/chat/completions",
  208. ImagePath: "api/paas/v4/images/generations",
  209. VideoPath: "api/paas/v4/videos/generations",
  210. };
  211. export const DEFAULT_INPUT_TEMPLATE = `{{input}}`; // input / time / model / lang
  212. // export const DEFAULT_SYSTEM_TEMPLATE = `
  213. // You are ChatGPT, a large language model trained by {{ServiceProvider}}.
  214. // Knowledge cutoff: {{cutoff}}
  215. // Current model: {{model}}
  216. // Current time: {{time}}
  217. // Latex inline: $x^2$
  218. // Latex block: $$e=mc^2$$
  219. // `;
  220. export const DEFAULT_SYSTEM_TEMPLATE = `
  221. You are ChatGPT, a large language model trained by {{ServiceProvider}}.
  222. Knowledge cutoff: {{cutoff}}
  223. Current model: {{model}}
  224. Current time: {{time}}
  225. Latex inline: \\(x^2\\)
  226. Latex block: $$e=mc^2$$
  227. `;
  228. export const MCP_TOOLS_TEMPLATE = `
  229. [clientId]
  230. {{ clientId }}
  231. [tools]
  232. {{ tools }}
  233. `;
  234. export const MCP_SYSTEM_TEMPLATE = `
  235. You are an AI assistant with access to system tools. Your role is to help users by combining natural language understanding with tool operations when needed.
  236. 1. AVAILABLE TOOLS:
  237. {{ MCP_TOOLS }}
  238. 2. WHEN TO USE TOOLS:
  239. - ALWAYS USE TOOLS when they can help answer user questions
  240. - DO NOT just describe what you could do - TAKE ACTION immediately
  241. - If you're not sure whether to use a tool, USE IT
  242. - Common triggers for tool use:
  243. * Questions about files or directories
  244. * Requests to check, list, or manipulate system resources
  245. * Any query that can be answered with available tools
  246. 3. HOW TO USE TOOLS:
  247. A. Tool Call Format:
  248. - Use markdown code blocks with format: \`\`\`json:mcp:{clientId}\`\`\`
  249. - Always include:
  250. * method: "tools/call"(Only this method is supported)
  251. * params:
  252. - name: must match an available primitive name
  253. - arguments: required parameters for the primitive
  254. B. Response Format:
  255. - Tool responses will come as user messages
  256. - Format: \`\`\`json:mcp-response:{clientId}\`\`\`
  257. - Wait for response before making another tool call
  258. C. Important Rules:
  259. - Only use tools/call method
  260. - Only ONE tool call per message
  261. - ALWAYS TAKE ACTION instead of just describing what you could do
  262. - Include the correct clientId in code block language tag
  263. - Verify arguments match the primitive's requirements
  264. 4. INTERACTION FLOW:
  265. A. When user makes a request:
  266. - IMMEDIATELY use appropriate tool if available
  267. - DO NOT ask if user wants you to use the tool
  268. - DO NOT just describe what you could do
  269. B. After receiving tool response:
  270. - Explain results clearly
  271. - Take next appropriate action if needed
  272. C. If tools fail:
  273. - Explain the error
  274. - Try alternative approach immediately
  275. 5. EXAMPLE INTERACTION:
  276. good example:
  277. \`\`\`json:mcp:filesystem
  278. {
  279. "method": "tools/call",
  280. "params": {
  281. "name": "list_allowed_directories",
  282. "arguments": {}
  283. }
  284. }
  285. \`\`\`"
  286. \`\`\`json:mcp-response:filesystem
  287. {
  288. "method": "tools/call",
  289. "params": {
  290. "name": "write_file",
  291. "arguments": {
  292. "path": "/Users/river/dev/nextchat/test/joke.txt",
  293. "content": "为什么数学书总是感到忧伤?因为它有太多的问题。"
  294. }
  295. }
  296. }
  297. \`\`\`
  298. follwing is the wrong! mcp json example:
  299. \`\`\`json:mcp:filesystem
  300. {
  301. "method": "write_file",
  302. "params": {
  303. "path": "NextChat_Information.txt",
  304. "content": "1"
  305. }
  306. }
  307. \`\`\`
  308. This is wrong because the method is not tools/call.
  309. \`\`\`{
  310. "method": "search_repositories",
  311. "params": {
  312. "query": "2oeee"
  313. }
  314. }
  315. \`\`\`
  316. This is wrong because the method is not tools/call.!!!!!!!!!!!
  317. the right format is:
  318. \`\`\`json:mcp:filesystem
  319. {
  320. "method": "tools/call",
  321. "params": {
  322. "name": "search_repositories",
  323. "arguments": {
  324. "query": "2oeee"
  325. }
  326. }
  327. }
  328. \`\`\`
  329. please follow the format strictly ONLY use tools/call method!!!!!!!!!!!
  330. `;
  331. export const SUMMARIZE_MODEL = "gpt-4o-mini";
  332. export const GEMINI_SUMMARIZE_MODEL = "gemini-pro";
  333. export const DEEPSEEK_SUMMARIZE_MODEL = "deepseek-chat";
  334. export const KnowledgeCutOffDate: Record<string, string> = {
  335. default: "2021-09",
  336. "gpt-4-turbo": "2023-12",
  337. "gpt-4-turbo-2024-04-09": "2023-12",
  338. "gpt-4-turbo-preview": "2023-12",
  339. "gpt-4o": "2023-10",
  340. "gpt-4o-2024-05-13": "2023-10",
  341. "gpt-4o-2024-08-06": "2023-10",
  342. "gpt-4o-2024-11-20": "2023-10",
  343. "chatgpt-4o-latest": "2023-10",
  344. "gpt-4o-mini": "2023-10",
  345. "gpt-4o-mini-2024-07-18": "2023-10",
  346. "gpt-4-vision-preview": "2023-04",
  347. "o1-mini-2024-09-12": "2023-10",
  348. "o1-mini": "2023-10",
  349. "o1-preview-2024-09-12": "2023-10",
  350. "o1-preview": "2023-10",
  351. "o1-2024-12-17": "2023-10",
  352. "o1": "2023-10",
  353. "o3-mini-2025-01-31": "2023-10",
  354. "o3-mini": "2023-10",
  355. // After improvements,
  356. // it's now easier to add "KnowledgeCutOffDate" instead of stupid hardcoding it, as was done previously.
  357. "gemini-pro": "2023-12",
  358. "gemini-pro-vision": "2023-12",
  359. "deepseek-chat": "2024-07",
  360. "deepseek-coder": "2024-07",
  361. };
  362. export const DEFAULT_TTS_ENGINE = "OpenAI-TTS";
  363. export const DEFAULT_TTS_ENGINES = ["OpenAI-TTS", "Edge-TTS"];
  364. export const DEFAULT_TTS_MODEL = "tts-1";
  365. export const DEFAULT_TTS_VOICE = "alloy";
  366. export const DEFAULT_TTS_MODELS = ["tts-1", "tts-1-hd"];
  367. export const DEFAULT_TTS_VOICES = [
  368. "alloy",
  369. "echo",
  370. "fable",
  371. "onyx",
  372. "nova",
  373. "shimmer",
  374. ];
  375. export const VISION_MODEL_REGEXES = [
  376. /vision/,
  377. /gpt-4o/,
  378. /claude-3/,
  379. /gemini-1\.5/,
  380. /gemini-exp/,
  381. /gemini-2\.0/,
  382. /learnlm/,
  383. /qwen-vl/,
  384. /qwen2-vl/,
  385. /gpt-4-turbo(?!.*preview)/, // Matches "gpt-4-turbo" but not "gpt-4-turbo-preview"
  386. /^dall-e-3$/, // Matches exactly "dall-e-3"
  387. /glm-4v/,
  388. ];
  389. export const EXCLUDE_VISION_MODEL_REGEXES = [/claude-3-5-haiku-20241022/];
  390. const openaiModels = [
  391. // As of July 2024, gpt-4o-mini should be used in place of gpt-3.5-turbo,
  392. // as it is cheaper, more capable, multimodal, and just as fast. gpt-3.5-turbo is still available for use in the API.
  393. "gpt-3.5-turbo",
  394. "gpt-3.5-turbo-1106",
  395. "gpt-3.5-turbo-0125",
  396. "gpt-4",
  397. "gpt-4-0613",
  398. "gpt-4-32k",
  399. "gpt-4-32k-0613",
  400. "gpt-4-turbo",
  401. "gpt-4-turbo-preview",
  402. "gpt-4o",
  403. "gpt-4o-2024-05-13",
  404. "gpt-4o-2024-08-06",
  405. "gpt-4o-2024-11-20",
  406. "chatgpt-4o-latest",
  407. "gpt-4o-mini",
  408. "gpt-4o-mini-2024-07-18",
  409. "gpt-4-vision-preview",
  410. "gpt-4-turbo-2024-04-09",
  411. "gpt-4-1106-preview",
  412. "dall-e-3",
  413. "o1-mini",
  414. "o1-preview",
  415. "o3-mini",
  416. ];
  417. const googleModels = [
  418. "gemini-1.0-pro", // Deprecated on 2/15/2025
  419. "gemini-1.5-pro-latest",
  420. "gemini-1.5-pro",
  421. "gemini-1.5-pro-002",
  422. "gemini-1.5-pro-exp-0827",
  423. "gemini-1.5-flash-latest",
  424. "gemini-1.5-flash-8b-latest",
  425. "gemini-1.5-flash",
  426. "gemini-1.5-flash-8b",
  427. "gemini-1.5-flash-002",
  428. "gemini-1.5-flash-exp-0827",
  429. "learnlm-1.5-pro-experimental",
  430. "gemini-exp-1114",
  431. "gemini-exp-1121",
  432. "gemini-exp-1206",
  433. "gemini-2.0-flash-exp",
  434. "gemini-2.0-flash-thinking-exp-1219",
  435. ];
  436. const anthropicModels = [
  437. "claude-instant-1.2",
  438. "claude-2.0",
  439. "claude-2.1",
  440. "claude-3-sonnet-20240229",
  441. "claude-3-opus-20240229",
  442. "claude-3-opus-latest",
  443. "claude-3-haiku-20240307",
  444. "claude-3-5-haiku-20241022",
  445. "claude-3-5-haiku-latest",
  446. "claude-3-5-sonnet-20240620",
  447. "claude-3-5-sonnet-20241022",
  448. "claude-3-5-sonnet-latest",
  449. ];
  450. const baiduModels = [
  451. "ernie-4.0-turbo-8k",
  452. "ernie-4.0-8k",
  453. "ernie-4.0-8k-preview",
  454. "ernie-4.0-8k-preview-0518",
  455. "ernie-4.0-8k-latest",
  456. "ernie-3.5-8k",
  457. "ernie-3.5-8k-0205",
  458. "ernie-speed-128k",
  459. "ernie-speed-8k",
  460. "ernie-lite-8k",
  461. "ernie-tiny-8k",
  462. ];
  463. const bytedanceModels = [
  464. "Doubao-lite-4k",
  465. "Doubao-lite-32k",
  466. "Doubao-lite-128k",
  467. "Doubao-pro-4k",
  468. "Doubao-pro-32k",
  469. "Doubao-pro-128k",
  470. ];
  471. const alibabaModes = [
  472. "qwen-turbo",
  473. "qwen-plus",
  474. "qwen-max",
  475. "qwen-max-0428",
  476. "qwen-max-0403",
  477. "qwen-max-0107",
  478. "qwen-max-longcontext",
  479. ];
  480. const tencentModels = [
  481. "hunyuan-pro",
  482. "hunyuan-standard",
  483. "hunyuan-lite",
  484. "hunyuan-role",
  485. "hunyuan-functioncall",
  486. "hunyuan-code",
  487. "hunyuan-vision",
  488. ];
  489. const moonshotModes = ["moonshot-v1-8k", "moonshot-v1-32k", "moonshot-v1-128k"];
  490. const iflytekModels = [
  491. "general",
  492. "generalv3",
  493. "pro-128k",
  494. "generalv3.5",
  495. "4.0Ultra",
  496. ];
  497. const deepseekModels = ["deepseek-chat", "deepseek-coder", "deepseek-reasoner"];
  498. const xAIModes = ["grok-beta"];
  499. const chatglmModels = [
  500. "glm-4-plus",
  501. "glm-4-0520",
  502. "glm-4",
  503. "glm-4-air",
  504. "glm-4-airx",
  505. "glm-4-long",
  506. "glm-4-flashx",
  507. "glm-4-flash",
  508. "glm-4v-plus",
  509. "glm-4v",
  510. "glm-4v-flash", // free
  511. "cogview-3-plus",
  512. "cogview-3",
  513. "cogview-3-flash", // free
  514. // 目前无法适配轮询任务
  515. // "cogvideox",
  516. // "cogvideox-flash", // free
  517. ];
  518. let seq = 1000; // 内置的模型序号生成器从1000开始
  519. export const DEFAULT_MODELS = [
  520. ...openaiModels.map((name) => ({
  521. name,
  522. available: true,
  523. sorted: seq++, // Global sequence sort(index)
  524. provider: {
  525. id: "openai",
  526. providerName: "OpenAI",
  527. providerType: "openai",
  528. sorted: 1, // 这里是固定的,确保顺序与之前内置的版本一致
  529. },
  530. })),
  531. ...openaiModels.map((name) => ({
  532. name,
  533. available: true,
  534. sorted: seq++,
  535. provider: {
  536. id: "azure",
  537. providerName: "Azure",
  538. providerType: "azure",
  539. sorted: 2,
  540. },
  541. })),
  542. ...googleModels.map((name) => ({
  543. name,
  544. available: true,
  545. sorted: seq++,
  546. provider: {
  547. id: "google",
  548. providerName: "Google",
  549. providerType: "google",
  550. sorted: 3,
  551. },
  552. })),
  553. ...anthropicModels.map((name) => ({
  554. name,
  555. available: true,
  556. sorted: seq++,
  557. provider: {
  558. id: "anthropic",
  559. providerName: "Anthropic",
  560. providerType: "anthropic",
  561. sorted: 4,
  562. },
  563. })),
  564. ...baiduModels.map((name) => ({
  565. name,
  566. available: true,
  567. sorted: seq++,
  568. provider: {
  569. id: "baidu",
  570. providerName: "Baidu",
  571. providerType: "baidu",
  572. sorted: 5,
  573. },
  574. })),
  575. ...bytedanceModels.map((name) => ({
  576. name,
  577. available: true,
  578. sorted: seq++,
  579. provider: {
  580. id: "bytedance",
  581. providerName: "ByteDance",
  582. providerType: "bytedance",
  583. sorted: 6,
  584. },
  585. })),
  586. ...alibabaModes.map((name) => ({
  587. name,
  588. available: true,
  589. sorted: seq++,
  590. provider: {
  591. id: "alibaba",
  592. providerName: "Alibaba",
  593. providerType: "alibaba",
  594. sorted: 7,
  595. },
  596. })),
  597. ...tencentModels.map((name) => ({
  598. name,
  599. available: true,
  600. sorted: seq++,
  601. provider: {
  602. id: "tencent",
  603. providerName: "Tencent",
  604. providerType: "tencent",
  605. sorted: 8,
  606. },
  607. })),
  608. ...moonshotModes.map((name) => ({
  609. name,
  610. available: true,
  611. sorted: seq++,
  612. provider: {
  613. id: "moonshot",
  614. providerName: "Moonshot",
  615. providerType: "moonshot",
  616. sorted: 9,
  617. },
  618. })),
  619. ...iflytekModels.map((name) => ({
  620. name,
  621. available: true,
  622. sorted: seq++,
  623. provider: {
  624. id: "iflytek",
  625. providerName: "Iflytek",
  626. providerType: "iflytek",
  627. sorted: 10,
  628. },
  629. })),
  630. ...xAIModes.map((name) => ({
  631. name,
  632. available: true,
  633. sorted: seq++,
  634. provider: {
  635. id: "xai",
  636. providerName: "XAI",
  637. providerType: "xai",
  638. sorted: 11,
  639. },
  640. })),
  641. ...chatglmModels.map((name) => ({
  642. name,
  643. available: true,
  644. sorted: seq++,
  645. provider: {
  646. id: "chatglm",
  647. providerName: "ChatGLM",
  648. providerType: "chatglm",
  649. sorted: 12,
  650. },
  651. })),
  652. ...deepseekModels.map((name) => ({
  653. name,
  654. available: true,
  655. sorted: seq++,
  656. provider: {
  657. id: "deepseek",
  658. providerName: "DeepSeek",
  659. providerType: "deepseek",
  660. sorted: 13,
  661. },
  662. })),
  663. ] as const;
  664. export const CHAT_PAGE_SIZE = 15;
  665. export const MAX_RENDER_MSG_COUNT = 45;
  666. // some famous webdav endpoints
  667. export const internalAllowedWebDavEndpoints = [
  668. "https://dav.jianguoyun.com/dav/",
  669. "https://dav.dropdav.com/",
  670. "https://dav.box.com/dav",
  671. "https://nanao.teracloud.jp/dav/",
  672. "https://bora.teracloud.jp/dav/",
  673. "https://webdav.4shared.com/",
  674. "https://dav.idrivesync.com",
  675. "https://webdav.yandex.com",
  676. "https://app.koofr.net/dav/Koofr",
  677. ];
  678. export const DEFAULT_GA_ID = "G-89WN60ZK2E";
  679. export const SAAS_CHAT_URL = "https://nextchat.dev/chat";
  680. export const SAAS_CHAT_UTM_URL = "https://nextchat.dev/chat?utm=github";