constant.ts 18 KB

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