constant.ts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  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": "2023-10",
  348. "o1-preview": "2023-10",
  349. // After improvements,
  350. // it's now easier to add "KnowledgeCutOffDate" instead of stupid hardcoding it, as was done previously.
  351. "gemini-pro": "2023-12",
  352. "gemini-pro-vision": "2023-12",
  353. "deepseek-chat": "2024-07",
  354. "deepseek-coder": "2024-07",
  355. };
  356. export const DEFAULT_TTS_ENGINE = "OpenAI-TTS";
  357. export const DEFAULT_TTS_ENGINES = ["OpenAI-TTS", "Edge-TTS"];
  358. export const DEFAULT_TTS_MODEL = "tts-1";
  359. export const DEFAULT_TTS_VOICE = "alloy";
  360. export const DEFAULT_TTS_MODELS = ["tts-1", "tts-1-hd"];
  361. export const DEFAULT_TTS_VOICES = [
  362. "alloy",
  363. "echo",
  364. "fable",
  365. "onyx",
  366. "nova",
  367. "shimmer",
  368. ];
  369. export const VISION_MODEL_REGEXES = [
  370. /vision/,
  371. /gpt-4o/,
  372. /claude-3/,
  373. /gemini-1\.5/,
  374. /gemini-exp/,
  375. /gemini-2\.0/,
  376. /learnlm/,
  377. /qwen-vl/,
  378. /qwen2-vl/,
  379. /gpt-4-turbo(?!.*preview)/, // Matches "gpt-4-turbo" but not "gpt-4-turbo-preview"
  380. /^dall-e-3$/, // Matches exactly "dall-e-3"
  381. /glm-4v/,
  382. ];
  383. export const EXCLUDE_VISION_MODEL_REGEXES = [/claude-3-5-haiku-20241022/];
  384. const openaiModels = [
  385. "gpt-3.5-turbo",
  386. "gpt-3.5-turbo-1106",
  387. "gpt-3.5-turbo-0125",
  388. "gpt-4",
  389. "gpt-4-0613",
  390. "gpt-4-32k",
  391. "gpt-4-32k-0613",
  392. "gpt-4-turbo",
  393. "gpt-4-turbo-preview",
  394. "gpt-4o",
  395. "gpt-4o-2024-05-13",
  396. "gpt-4o-2024-08-06",
  397. "gpt-4o-2024-11-20",
  398. "chatgpt-4o-latest",
  399. "gpt-4o-mini",
  400. "gpt-4o-mini-2024-07-18",
  401. "gpt-4-vision-preview",
  402. "gpt-4-turbo-2024-04-09",
  403. "gpt-4-1106-preview",
  404. "dall-e-3",
  405. "o1-mini",
  406. "o1-preview",
  407. ];
  408. const googleModels = [
  409. "gemini-1.0-pro", // Deprecated on 2/15/2025
  410. "gemini-1.5-pro-latest",
  411. "gemini-1.5-pro",
  412. "gemini-1.5-pro-002",
  413. "gemini-1.5-pro-exp-0827",
  414. "gemini-1.5-flash-latest",
  415. "gemini-1.5-flash-8b-latest",
  416. "gemini-1.5-flash",
  417. "gemini-1.5-flash-8b",
  418. "gemini-1.5-flash-002",
  419. "gemini-1.5-flash-exp-0827",
  420. "learnlm-1.5-pro-experimental",
  421. "gemini-exp-1114",
  422. "gemini-exp-1121",
  423. "gemini-exp-1206",
  424. "gemini-2.0-flash-exp",
  425. "gemini-2.0-flash-thinking-exp-1219",
  426. ];
  427. const anthropicModels = [
  428. "claude-instant-1.2",
  429. "claude-2.0",
  430. "claude-2.1",
  431. "claude-3-sonnet-20240229",
  432. "claude-3-opus-20240229",
  433. "claude-3-opus-latest",
  434. "claude-3-haiku-20240307",
  435. "claude-3-5-haiku-20241022",
  436. "claude-3-5-haiku-latest",
  437. "claude-3-5-sonnet-20240620",
  438. "claude-3-5-sonnet-20241022",
  439. "claude-3-5-sonnet-latest",
  440. ];
  441. const baiduModels = [
  442. "ernie-4.0-turbo-8k",
  443. "ernie-4.0-8k",
  444. "ernie-4.0-8k-preview",
  445. "ernie-4.0-8k-preview-0518",
  446. "ernie-4.0-8k-latest",
  447. "ernie-3.5-8k",
  448. "ernie-3.5-8k-0205",
  449. "ernie-speed-128k",
  450. "ernie-speed-8k",
  451. "ernie-lite-8k",
  452. "ernie-tiny-8k",
  453. ];
  454. const bytedanceModels = [
  455. "Doubao-lite-4k",
  456. "Doubao-lite-32k",
  457. "Doubao-lite-128k",
  458. "Doubao-pro-4k",
  459. "Doubao-pro-32k",
  460. "Doubao-pro-128k",
  461. ];
  462. const alibabaModes = [
  463. "qwen-turbo",
  464. "qwen-plus",
  465. "qwen-max",
  466. "qwen-max-0428",
  467. "qwen-max-0403",
  468. "qwen-max-0107",
  469. "qwen-max-longcontext",
  470. ];
  471. const tencentModels = [
  472. "hunyuan-pro",
  473. "hunyuan-standard",
  474. "hunyuan-lite",
  475. "hunyuan-role",
  476. "hunyuan-functioncall",
  477. "hunyuan-code",
  478. "hunyuan-vision",
  479. ];
  480. const moonshotModes = ["moonshot-v1-8k", "moonshot-v1-32k", "moonshot-v1-128k"];
  481. const iflytekModels = [
  482. "general",
  483. "generalv3",
  484. "pro-128k",
  485. "generalv3.5",
  486. "4.0Ultra",
  487. ];
  488. const deepseekModels = ["deepseek-chat", "deepseek-coder", "deepseek-reasoner"];
  489. const xAIModes = ["grok-beta"];
  490. const chatglmModels = [
  491. "glm-4-plus",
  492. "glm-4-0520",
  493. "glm-4",
  494. "glm-4-air",
  495. "glm-4-airx",
  496. "glm-4-long",
  497. "glm-4-flashx",
  498. "glm-4-flash",
  499. "glm-4v-plus",
  500. "glm-4v",
  501. "glm-4v-flash", // free
  502. "cogview-3-plus",
  503. "cogview-3",
  504. "cogview-3-flash", // free
  505. // 目前无法适配轮询任务
  506. // "cogvideox",
  507. // "cogvideox-flash", // free
  508. ];
  509. let seq = 1000; // 内置的模型序号生成器从1000开始
  510. export const DEFAULT_MODELS = [
  511. ...openaiModels.map((name) => ({
  512. name,
  513. available: true,
  514. sorted: seq++, // Global sequence sort(index)
  515. provider: {
  516. id: "openai",
  517. providerName: "OpenAI",
  518. providerType: "openai",
  519. sorted: 1, // 这里是固定的,确保顺序与之前内置的版本一致
  520. },
  521. })),
  522. ...openaiModels.map((name) => ({
  523. name,
  524. available: true,
  525. sorted: seq++,
  526. provider: {
  527. id: "azure",
  528. providerName: "Azure",
  529. providerType: "azure",
  530. sorted: 2,
  531. },
  532. })),
  533. ...googleModels.map((name) => ({
  534. name,
  535. available: true,
  536. sorted: seq++,
  537. provider: {
  538. id: "google",
  539. providerName: "Google",
  540. providerType: "google",
  541. sorted: 3,
  542. },
  543. })),
  544. ...anthropicModels.map((name) => ({
  545. name,
  546. available: true,
  547. sorted: seq++,
  548. provider: {
  549. id: "anthropic",
  550. providerName: "Anthropic",
  551. providerType: "anthropic",
  552. sorted: 4,
  553. },
  554. })),
  555. ...baiduModels.map((name) => ({
  556. name,
  557. available: true,
  558. sorted: seq++,
  559. provider: {
  560. id: "baidu",
  561. providerName: "Baidu",
  562. providerType: "baidu",
  563. sorted: 5,
  564. },
  565. })),
  566. ...bytedanceModels.map((name) => ({
  567. name,
  568. available: true,
  569. sorted: seq++,
  570. provider: {
  571. id: "bytedance",
  572. providerName: "ByteDance",
  573. providerType: "bytedance",
  574. sorted: 6,
  575. },
  576. })),
  577. ...alibabaModes.map((name) => ({
  578. name,
  579. available: true,
  580. sorted: seq++,
  581. provider: {
  582. id: "alibaba",
  583. providerName: "Alibaba",
  584. providerType: "alibaba",
  585. sorted: 7,
  586. },
  587. })),
  588. ...tencentModels.map((name) => ({
  589. name,
  590. available: true,
  591. sorted: seq++,
  592. provider: {
  593. id: "tencent",
  594. providerName: "Tencent",
  595. providerType: "tencent",
  596. sorted: 8,
  597. },
  598. })),
  599. ...moonshotModes.map((name) => ({
  600. name,
  601. available: true,
  602. sorted: seq++,
  603. provider: {
  604. id: "moonshot",
  605. providerName: "Moonshot",
  606. providerType: "moonshot",
  607. sorted: 9,
  608. },
  609. })),
  610. ...iflytekModels.map((name) => ({
  611. name,
  612. available: true,
  613. sorted: seq++,
  614. provider: {
  615. id: "iflytek",
  616. providerName: "Iflytek",
  617. providerType: "iflytek",
  618. sorted: 10,
  619. },
  620. })),
  621. ...xAIModes.map((name) => ({
  622. name,
  623. available: true,
  624. sorted: seq++,
  625. provider: {
  626. id: "xai",
  627. providerName: "XAI",
  628. providerType: "xai",
  629. sorted: 11,
  630. },
  631. })),
  632. ...chatglmModels.map((name) => ({
  633. name,
  634. available: true,
  635. sorted: seq++,
  636. provider: {
  637. id: "chatglm",
  638. providerName: "ChatGLM",
  639. providerType: "chatglm",
  640. sorted: 12,
  641. },
  642. })),
  643. ...deepseekModels.map((name) => ({
  644. name,
  645. available: true,
  646. sorted: seq++,
  647. provider: {
  648. id: "deepseek",
  649. providerName: "DeepSeek",
  650. providerType: "deepseek",
  651. sorted: 13,
  652. },
  653. })),
  654. ] as const;
  655. export const CHAT_PAGE_SIZE = 15;
  656. export const MAX_RENDER_MSG_COUNT = 45;
  657. // some famous webdav endpoints
  658. export const internalAllowedWebDavEndpoints = [
  659. "https://dav.jianguoyun.com/dav/",
  660. "https://dav.dropdav.com/",
  661. "https://dav.box.com/dav",
  662. "https://nanao.teracloud.jp/dav/",
  663. "https://bora.teracloud.jp/dav/",
  664. "https://webdav.4shared.com/",
  665. "https://dav.idrivesync.com",
  666. "https://webdav.yandex.com",
  667. "https://app.koofr.net/dav/Koofr",
  668. ];
  669. export const DEFAULT_GA_ID = "G-89WN60ZK2E";
  670. export const SAAS_CHAT_URL = "https://nextchat.club";
  671. export const SAAS_CHAT_UTM_URL = "https://nextchat.club?utm=github";