constant.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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://chatgpt2.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 MAX_SIDEBAR_WIDTH = 500;
  40. export const MIN_SIDEBAR_WIDTH = 230;
  41. export const NARROW_SIDEBAR_WIDTH = 100;
  42. export const ACCESS_CODE_PREFIX = "nk-";
  43. export const LAST_INPUT_KEY = "last-input";
  44. export const UNFINISHED_INPUT = (id: string) => "unfinished-input-" + id;
  45. export const STORAGE_KEY = "chatgpt-next-web";
  46. export const REQUEST_TIMEOUT_MS = 60000;
  47. export const EXPORT_MESSAGE_CLASS_NAME = "export-markdown";
  48. export const OpenaiPath = {
  49. ChatPath: "v1/chat/completions",
  50. UsagePath: "dashboard/billing/usage",
  51. SubsPath: "dashboard/billing/subscription",
  52. ListModelPath: "v1/models",
  53. };
  54. export const DEFAULT_INPUT_TEMPLATE = `{{input}}`; // input / time / model / lang
  55. export const DEFAULT_SYSTEM_TEMPLATE = `
  56. You are ChatGPT, a large language model trained by OpenAI.
  57. Knowledge cutoff: 2021-09
  58. Current model: {{model}}
  59. Current time: {{time}}`;
  60. export const SUMMARIZE_MODEL = "gpt-3.5-turbo";
  61. export const DEFAULT_MODELS = [
  62. {
  63. name: "gpt-4",
  64. available: true,
  65. },
  66. {
  67. name: "gpt-4-0314",
  68. available: true,
  69. },
  70. {
  71. name: "gpt-4-0613",
  72. available: true,
  73. },
  74. {
  75. name: "gpt-4-32k",
  76. available: true,
  77. },
  78. {
  79. name: "gpt-4-32k-0314",
  80. available: true,
  81. },
  82. {
  83. name: "gpt-4-32k-0613",
  84. available: true,
  85. },
  86. {
  87. name: "gpt-3.5-turbo",
  88. available: true,
  89. },
  90. {
  91. name: "gpt-3.5-turbo-0301",
  92. available: true,
  93. },
  94. {
  95. name: "gpt-3.5-turbo-0613",
  96. available: true,
  97. },
  98. {
  99. name: "gpt-3.5-turbo-16k",
  100. available: true,
  101. },
  102. {
  103. name: "gpt-3.5-turbo-16k-0613",
  104. available: true,
  105. },
  106. ] as const;
  107. export const CHAT_PAGE_SIZE = 15;
  108. export const MAX_RENDER_MSG_COUNT = 45;