constant.ts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  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. export const MCP_SYSTEM_TEMPLATE = `
  223. 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.
  224. 1. TOOLS AVAILABLE:
  225. {{ MCP_PRIMITIVES }}
  226. 2. WHEN TO USE TOOLS:
  227. - ALWAYS USE TOOLS when they can help answer user questions
  228. - DO NOT just describe what you could do - TAKE ACTION immediately
  229. - If you're not sure whether to use a tool, USE IT
  230. - Common triggers for tool use:
  231. * Questions about files or directories
  232. * Requests to check, list, or manipulate system resources
  233. * Any query that can be answered with available tools
  234. 3. HOW TO USE TOOLS:
  235. A. Tool Call Format:
  236. - Use markdown code blocks with format: \`\`\`json:mcp:{clientId}\`\`\`
  237. - Always include:
  238. * method: "tools/call"
  239. * params:
  240. - name: must match an available primitive name
  241. - arguments: required parameters for the primitive
  242. B. Response Format:
  243. - Tool responses will come as user messages
  244. - Format: \`\`\`json:mcp-response:{clientId}\`\`\`
  245. - Wait for response before making another tool call
  246. C. Important Rules:
  247. - Only ONE tool call per message
  248. - ALWAYS TAKE ACTION instead of just describing what you could do
  249. - Include the correct clientId in code block language tag
  250. - Verify arguments match the primitive's requirements
  251. 4. INTERACTION FLOW:
  252. A. When user makes a request:
  253. - IMMEDIATELY use appropriate tool if available
  254. - DO NOT ask if user wants you to use the tool
  255. - DO NOT just describe what you could do
  256. B. After receiving tool response:
  257. - Explain results clearly
  258. - Take next appropriate action if needed
  259. C. If tools fail:
  260. - Explain the error
  261. - Try alternative approach immediately
  262. 5. EXAMPLE INTERACTION:
  263. User: "What files do I have on my desktop?"
  264. Assistant: "I'll check which directories I have access to.
  265. \`\`\`json:mcp:filesystem
  266. {
  267. "method": "tools/call",
  268. "params": {
  269. "name": "list_allowed_directories",
  270. "arguments": {}
  271. }
  272. }
  273. \`\`\`"
  274. User: "\`\`\`json:mcp-response:filesystem
  275. {
  276. "directories": ["/path/to/desktop"]
  277. }
  278. \`\`\`"
  279. Assistant: "I can see that I have access to your desktop directory. Let me list its contents for you.
  280. \`\`\`json:mcp:filesystem
  281. {
  282. "method": "tools/call",
  283. "params": {
  284. "name": "list_directory",
  285. "arguments": {
  286. "path": "/path/to/desktop"
  287. }
  288. }
  289. }
  290. \`\`\`"
  291. User: "\`\`\`json:mcp-response:filesystem
  292. {
  293. "content": [
  294. {
  295. "type": "text",
  296. "text": "[FILE] document.txt\n[DIR] folder1\n[DIR] folder2\n[FILE] image.png\n[FILE] notes.md"
  297. }
  298. ]
  299. }
  300. \`\`\`"
  301. Assistant: "I've found the contents of your desktop. Here's what you have:
  302. Files:
  303. - document.txt
  304. - image.png
  305. - notes.md
  306. Directories:
  307. - folder1
  308. - folder2
  309. Would you like to explore any of these directories or perform other operations with these files?"
  310. `;
  311. export const SUMMARIZE_MODEL = "gpt-4o-mini";
  312. export const GEMINI_SUMMARIZE_MODEL = "gemini-pro";
  313. export const KnowledgeCutOffDate: Record<string, string> = {
  314. default: "2021-09",
  315. "gpt-4-turbo": "2023-12",
  316. "gpt-4-turbo-2024-04-09": "2023-12",
  317. "gpt-4-turbo-preview": "2023-12",
  318. "gpt-4o": "2023-10",
  319. "gpt-4o-2024-05-13": "2023-10",
  320. "gpt-4o-2024-08-06": "2023-10",
  321. "gpt-4o-2024-11-20": "2023-10",
  322. "chatgpt-4o-latest": "2023-10",
  323. "gpt-4o-mini": "2023-10",
  324. "gpt-4o-mini-2024-07-18": "2023-10",
  325. "gpt-4-vision-preview": "2023-04",
  326. "o1-mini": "2023-10",
  327. "o1-preview": "2023-10",
  328. // After improvements,
  329. // it's now easier to add "KnowledgeCutOffDate" instead of stupid hardcoding it, as was done previously.
  330. "gemini-pro": "2023-12",
  331. "gemini-pro-vision": "2023-12",
  332. };
  333. export const DEFAULT_TTS_ENGINE = "OpenAI-TTS";
  334. export const DEFAULT_TTS_ENGINES = ["OpenAI-TTS", "Edge-TTS"];
  335. export const DEFAULT_TTS_MODEL = "tts-1";
  336. export const DEFAULT_TTS_VOICE = "alloy";
  337. export const DEFAULT_TTS_MODELS = ["tts-1", "tts-1-hd"];
  338. export const DEFAULT_TTS_VOICES = [
  339. "alloy",
  340. "echo",
  341. "fable",
  342. "onyx",
  343. "nova",
  344. "shimmer",
  345. ];
  346. export const VISION_MODEL_REGEXES = [
  347. /vision/,
  348. /gpt-4o/,
  349. /claude-3/,
  350. /gemini-1\.5/,
  351. /gemini-exp/,
  352. /gemini-2\.0/,
  353. /learnlm/,
  354. /qwen-vl/,
  355. /qwen2-vl/,
  356. /gpt-4-turbo(?!.*preview)/, // Matches "gpt-4-turbo" but not "gpt-4-turbo-preview"
  357. /^dall-e-3$/, // Matches exactly "dall-e-3"
  358. ];
  359. export const EXCLUDE_VISION_MODEL_REGEXES = [/claude-3-5-haiku-20241022/];
  360. const openaiModels = [
  361. "gpt-3.5-turbo",
  362. "gpt-3.5-turbo-1106",
  363. "gpt-3.5-turbo-0125",
  364. "gpt-4",
  365. "gpt-4-0613",
  366. "gpt-4-32k",
  367. "gpt-4-32k-0613",
  368. "gpt-4-turbo",
  369. "gpt-4-turbo-preview",
  370. "gpt-4o",
  371. "gpt-4o-2024-05-13",
  372. "gpt-4o-2024-08-06",
  373. "gpt-4o-2024-11-20",
  374. "chatgpt-4o-latest",
  375. "gpt-4o-mini",
  376. "gpt-4o-mini-2024-07-18",
  377. "gpt-4-vision-preview",
  378. "gpt-4-turbo-2024-04-09",
  379. "gpt-4-1106-preview",
  380. "dall-e-3",
  381. "o1-mini",
  382. "o1-preview",
  383. ];
  384. const googleModels = [
  385. "gemini-1.0-pro", // Deprecated on 2/15/2025
  386. "gemini-1.5-pro-latest",
  387. "gemini-1.5-pro",
  388. "gemini-1.5-pro-002",
  389. "gemini-1.5-pro-exp-0827",
  390. "gemini-1.5-flash-latest",
  391. "gemini-1.5-flash-8b-latest",
  392. "gemini-1.5-flash",
  393. "gemini-1.5-flash-8b",
  394. "gemini-1.5-flash-002",
  395. "gemini-1.5-flash-exp-0827",
  396. "learnlm-1.5-pro-experimental",
  397. "gemini-exp-1114",
  398. "gemini-exp-1121",
  399. "gemini-exp-1206",
  400. "gemini-2.0-flash-exp",
  401. "gemini-2.0-flash-thinking-exp-1219",
  402. ];
  403. const anthropicModels = [
  404. "claude-instant-1.2",
  405. "claude-2.0",
  406. "claude-2.1",
  407. "claude-3-sonnet-20240229",
  408. "claude-3-opus-20240229",
  409. "claude-3-opus-latest",
  410. "claude-3-haiku-20240307",
  411. "claude-3-5-haiku-20241022",
  412. "claude-3-5-haiku-latest",
  413. "claude-3-5-sonnet-20240620",
  414. "claude-3-5-sonnet-20241022",
  415. "claude-3-5-sonnet-latest",
  416. ];
  417. const baiduModels = [
  418. "ernie-4.0-turbo-8k",
  419. "ernie-4.0-8k",
  420. "ernie-4.0-8k-preview",
  421. "ernie-4.0-8k-preview-0518",
  422. "ernie-4.0-8k-latest",
  423. "ernie-3.5-8k",
  424. "ernie-3.5-8k-0205",
  425. "ernie-speed-128k",
  426. "ernie-speed-8k",
  427. "ernie-lite-8k",
  428. "ernie-tiny-8k",
  429. ];
  430. const bytedanceModels = [
  431. "Doubao-lite-4k",
  432. "Doubao-lite-32k",
  433. "Doubao-lite-128k",
  434. "Doubao-pro-4k",
  435. "Doubao-pro-32k",
  436. "Doubao-pro-128k",
  437. ];
  438. const alibabaModes = [
  439. "qwen-turbo",
  440. "qwen-plus",
  441. "qwen-max",
  442. "qwen-max-0428",
  443. "qwen-max-0403",
  444. "qwen-max-0107",
  445. "qwen-max-longcontext",
  446. ];
  447. const tencentModels = [
  448. "hunyuan-pro",
  449. "hunyuan-standard",
  450. "hunyuan-lite",
  451. "hunyuan-role",
  452. "hunyuan-functioncall",
  453. "hunyuan-code",
  454. "hunyuan-vision",
  455. ];
  456. const moonshotModes = ["moonshot-v1-8k", "moonshot-v1-32k", "moonshot-v1-128k"];
  457. const iflytekModels = [
  458. "general",
  459. "generalv3",
  460. "pro-128k",
  461. "generalv3.5",
  462. "4.0Ultra",
  463. ];
  464. const xAIModes = ["grok-beta"];
  465. const chatglmModels = [
  466. "glm-4-plus",
  467. "glm-4-0520",
  468. "glm-4",
  469. "glm-4-air",
  470. "glm-4-airx",
  471. "glm-4-long",
  472. "glm-4-flashx",
  473. "glm-4-flash",
  474. ];
  475. let seq = 1000; // 内置的模型序号生成器从1000开始
  476. export const DEFAULT_MODELS = [
  477. ...openaiModels.map((name) => ({
  478. name,
  479. available: true,
  480. sorted: seq++, // Global sequence sort(index)
  481. provider: {
  482. id: "openai",
  483. providerName: "OpenAI",
  484. providerType: "openai",
  485. sorted: 1, // 这里是固定的,确保顺序与之前内置的版本一致
  486. },
  487. })),
  488. ...openaiModels.map((name) => ({
  489. name,
  490. available: true,
  491. sorted: seq++,
  492. provider: {
  493. id: "azure",
  494. providerName: "Azure",
  495. providerType: "azure",
  496. sorted: 2,
  497. },
  498. })),
  499. ...googleModels.map((name) => ({
  500. name,
  501. available: true,
  502. sorted: seq++,
  503. provider: {
  504. id: "google",
  505. providerName: "Google",
  506. providerType: "google",
  507. sorted: 3,
  508. },
  509. })),
  510. ...anthropicModels.map((name) => ({
  511. name,
  512. available: true,
  513. sorted: seq++,
  514. provider: {
  515. id: "anthropic",
  516. providerName: "Anthropic",
  517. providerType: "anthropic",
  518. sorted: 4,
  519. },
  520. })),
  521. ...baiduModels.map((name) => ({
  522. name,
  523. available: true,
  524. sorted: seq++,
  525. provider: {
  526. id: "baidu",
  527. providerName: "Baidu",
  528. providerType: "baidu",
  529. sorted: 5,
  530. },
  531. })),
  532. ...bytedanceModels.map((name) => ({
  533. name,
  534. available: true,
  535. sorted: seq++,
  536. provider: {
  537. id: "bytedance",
  538. providerName: "ByteDance",
  539. providerType: "bytedance",
  540. sorted: 6,
  541. },
  542. })),
  543. ...alibabaModes.map((name) => ({
  544. name,
  545. available: true,
  546. sorted: seq++,
  547. provider: {
  548. id: "alibaba",
  549. providerName: "Alibaba",
  550. providerType: "alibaba",
  551. sorted: 7,
  552. },
  553. })),
  554. ...tencentModels.map((name) => ({
  555. name,
  556. available: true,
  557. sorted: seq++,
  558. provider: {
  559. id: "tencent",
  560. providerName: "Tencent",
  561. providerType: "tencent",
  562. sorted: 8,
  563. },
  564. })),
  565. ...moonshotModes.map((name) => ({
  566. name,
  567. available: true,
  568. sorted: seq++,
  569. provider: {
  570. id: "moonshot",
  571. providerName: "Moonshot",
  572. providerType: "moonshot",
  573. sorted: 9,
  574. },
  575. })),
  576. ...iflytekModels.map((name) => ({
  577. name,
  578. available: true,
  579. sorted: seq++,
  580. provider: {
  581. id: "iflytek",
  582. providerName: "Iflytek",
  583. providerType: "iflytek",
  584. sorted: 10,
  585. },
  586. })),
  587. ...xAIModes.map((name) => ({
  588. name,
  589. available: true,
  590. sorted: seq++,
  591. provider: {
  592. id: "xai",
  593. providerName: "XAI",
  594. providerType: "xai",
  595. sorted: 11,
  596. },
  597. })),
  598. ...chatglmModels.map((name) => ({
  599. name,
  600. available: true,
  601. sorted: seq++,
  602. provider: {
  603. id: "chatglm",
  604. providerName: "ChatGLM",
  605. providerType: "chatglm",
  606. sorted: 12,
  607. },
  608. })),
  609. ] as const;
  610. export const CHAT_PAGE_SIZE = 15;
  611. export const MAX_RENDER_MSG_COUNT = 45;
  612. // some famous webdav endpoints
  613. export const internalAllowedWebDavEndpoints = [
  614. "https://dav.jianguoyun.com/dav/",
  615. "https://dav.dropdav.com/",
  616. "https://dav.box.com/dav",
  617. "https://nanao.teracloud.jp/dav/",
  618. "https://bora.teracloud.jp/dav/",
  619. "https://webdav.4shared.com/",
  620. "https://dav.idrivesync.com",
  621. "https://webdav.yandex.com",
  622. "https://app.koofr.net/dav/Koofr",
  623. ];
  624. export const DEFAULT_GA_ID = "G-89WN60ZK2E";
  625. export const PLUGINS = [
  626. { name: "Plugins", path: Path.Plugins },
  627. { name: "Stable Diffusion", path: Path.Sd },
  628. { name: "Search Chat", path: Path.SearchChat },
  629. ];
  630. export const SAAS_CHAT_URL = "https://nextchat.dev/chat";
  631. export const SAAS_CHAT_UTM_URL = "https://nextchat.dev/chat?utm=github";