constant.ts 18 KB

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