constant.ts 18 KB

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