constant.ts 3.1 KB

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