constant.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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_CORS_HOST = "https://ab.nextweb.fun";
  11. export const DEFAULT_API_HOST = `${DEFAULT_CORS_HOST}/api/proxy`;
  12. export const OPENAI_BASE_URL = "https://api.openai.com";
  13. export enum Path {
  14. Home = "/",
  15. Chat = "/chat",
  16. Settings = "/settings",
  17. NewChat = "/new-chat",
  18. Masks = "/masks",
  19. Auth = "/auth",
  20. }
  21. export enum ApiPath {
  22. Cors = "/api/cors",
  23. }
  24. export enum SlotID {
  25. AppBody = "app-body",
  26. }
  27. export enum FileName {
  28. Masks = "masks.json",
  29. Prompts = "prompts.json",
  30. }
  31. export enum StoreKey {
  32. Chat = "chat-next-web-store",
  33. Access = "access-control",
  34. Config = "app-config",
  35. Mask = "mask-store",
  36. Prompt = "prompt-store",
  37. Update = "chat-update",
  38. Sync = "sync",
  39. }
  40. export const DEFAULT_SIDEBAR_WIDTH = 300;
  41. export const MAX_SIDEBAR_WIDTH = 500;
  42. export const MIN_SIDEBAR_WIDTH = 230;
  43. export const NARROW_SIDEBAR_WIDTH = 100;
  44. export const ACCESS_CODE_PREFIX = "nk-";
  45. export const LAST_INPUT_KEY = "last-input";
  46. export const UNFINISHED_INPUT = (id: string) => "unfinished-input-" + id;
  47. export const STORAGE_KEY = "chatgpt-next-web";
  48. export const REQUEST_TIMEOUT_MS = 60000;
  49. export const EXPORT_MESSAGE_CLASS_NAME = "export-markdown";
  50. export const OpenaiPath = {
  51. ChatPath: "v1/chat/completions",
  52. UsagePath: "dashboard/billing/usage",
  53. SubsPath: "dashboard/billing/subscription",
  54. ListModelPath: "v1/models",
  55. };
  56. export const DEFAULT_INPUT_TEMPLATE = `{{input}}`; // input / time / model / lang
  57. export const DEFAULT_SYSTEM_TEMPLATE = `
  58. You are ChatGPT, a large language model trained by OpenAI.
  59. Knowledge cutoff: {{cutoff}}
  60. Current model: {{model}}
  61. Current time: {{time}}
  62. `;
  63. export const SUMMARIZE_MODEL = "gpt-3.5-turbo";
  64. export const KnowledgeCutOffDate: Record<string, string> = {
  65. default: "2021-09",
  66. "gpt-3.5-turbo-1106": "2023-04",
  67. "gpt-4-1106-preview": "2023-04",
  68. "gpt-4-vision-preview": "2023-04",
  69. };
  70. export const DEFAULT_MODELS = [
  71. {
  72. name: "gpt-4",
  73. available: true,
  74. },
  75. {
  76. name: "gpt-4-0314",
  77. available: true,
  78. },
  79. {
  80. name: "gpt-4-0613",
  81. available: true,
  82. },
  83. {
  84. name: "gpt-4-32k",
  85. available: true,
  86. },
  87. {
  88. name: "gpt-4-32k-0314",
  89. available: true,
  90. },
  91. {
  92. name: "gpt-4-32k-0613",
  93. available: true,
  94. },
  95. {
  96. name: "gpt-4-1106-preview",
  97. available: true,
  98. },
  99. {
  100. name: "gpt-4-vision-preview",
  101. available: true,
  102. },
  103. {
  104. name: "gpt-3.5-turbo",
  105. available: true,
  106. },
  107. {
  108. name: "gpt-3.5-turbo-0301",
  109. available: true,
  110. },
  111. {
  112. name: "gpt-3.5-turbo-0613",
  113. available: true,
  114. },
  115. {
  116. name: "gpt-3.5-turbo-1106",
  117. available: true,
  118. },
  119. {
  120. name: "gpt-3.5-turbo-16k",
  121. available: true,
  122. },
  123. {
  124. name: "gpt-3.5-turbo-16k-0613",
  125. available: true,
  126. },
  127. ] as const;
  128. export const CHAT_PAGE_SIZE = 15;
  129. export const MAX_RENDER_MSG_COUNT = 45;