constant.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. export const OWNER = "Yidadaa";
  2. export const REPO = "ChatGPT-Next-Web";
  3. export const REPO_URL = `https://github.com/${OWNER}/${REPO}`;
  4. export const ISSUE_URL = `https://github.com/${OWNER}/${REPO}/issues`;
  5. export const UPDATE_URL = `${REPO_URL}#keep-updated`;
  6. export const RELEASE_URL = `${REPO_URL}/releases`;
  7. export const FETCH_COMMIT_URL = `https://api.github.com/repos/${OWNER}/${REPO}/commits?per_page=1`;
  8. export const FETCH_TAG_URL = `https://api.github.com/repos/${OWNER}/${REPO}/tags?per_page=1`;
  9. export const RUNTIME_CONFIG_DOM = "danger-runtime-config";
  10. export const DEFAULT_API_HOST = "https://chatgpt1.nextweb.fun/api/proxy";
  11. export enum Path {
  12. Home = "/",
  13. Chat = "/chat",
  14. Settings = "/settings",
  15. NewChat = "/new-chat",
  16. Masks = "/masks",
  17. Auth = "/auth",
  18. }
  19. export enum SlotID {
  20. AppBody = "app-body",
  21. }
  22. export enum FileName {
  23. Masks = "masks.json",
  24. Prompts = "prompts.json",
  25. }
  26. export enum StoreKey {
  27. Chat = "chat-next-web-store",
  28. Access = "access-control",
  29. Config = "app-config",
  30. Mask = "mask-store",
  31. Prompt = "prompt-store",
  32. Update = "chat-update",
  33. Sync = "sync",
  34. }
  35. export const MAX_SIDEBAR_WIDTH = 500;
  36. export const MIN_SIDEBAR_WIDTH = 230;
  37. export const NARROW_SIDEBAR_WIDTH = 100;
  38. export const ACCESS_CODE_PREFIX = "ak-";
  39. export const LAST_INPUT_KEY = "last-input";
  40. export const REQUEST_TIMEOUT_MS = 60000;
  41. export const EXPORT_MESSAGE_CLASS_NAME = "export-markdown";
  42. export const OpenaiPath = {
  43. ChatPath: "v1/chat/completions",
  44. UsagePath: "dashboard/billing/usage",
  45. SubsPath: "dashboard/billing/subscription",
  46. ListModelPath: "v1/models",
  47. };
  48. export const DEFAULT_INPUT_TEMPLATE = `{{input}}`; // input / time / model / lang
  49. export const DEFAULT_SYSTEM_TEMPLATE = `
  50. You are ChatGPT, a large language model trained by OpenAI.
  51. Knowledge cutoff: 2021-09
  52. Current model: {{model}}
  53. Current time: {{time}}`;
  54. export const DEFAULT_MODELS = [
  55. {
  56. name: "gpt-4",
  57. available: true,
  58. },
  59. {
  60. name: "gpt-4-0314",
  61. available: true,
  62. },
  63. {
  64. name: "gpt-4-0613",
  65. available: true,
  66. },
  67. {
  68. name: "gpt-4-32k",
  69. available: true,
  70. },
  71. {
  72. name: "gpt-4-32k-0314",
  73. available: true,
  74. },
  75. {
  76. name: "gpt-4-32k-0613",
  77. available: true,
  78. },
  79. {
  80. name: "gpt-3.5-turbo",
  81. available: true,
  82. },
  83. {
  84. name: "gpt-3.5-turbo-0301",
  85. available: true,
  86. },
  87. {
  88. name: "gpt-3.5-turbo-0613",
  89. available: true,
  90. },
  91. {
  92. name: "gpt-3.5-turbo-16k",
  93. available: true,
  94. },
  95. {
  96. name: "gpt-3.5-turbo-16k-0613",
  97. available: true,
  98. },
  99. {
  100. name: "qwen-v1", // 通义千问
  101. available: false,
  102. },
  103. {
  104. name: "ernie", // 文心一言
  105. available: false,
  106. },
  107. {
  108. name: "spark", // 讯飞星火
  109. available: false,
  110. },
  111. {
  112. name: "llama", // llama
  113. available: false,
  114. },
  115. {
  116. name: "chatglm", // chatglm-6b
  117. available: false,
  118. },
  119. ] as const;