constant.ts 18 KB

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