constant.ts 18 KB

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