constant.ts 2.9 KB

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