diff --git a/app/config/server.ts b/app/config/server.ts
index 6eab9ebec..2df806fed 100644
--- a/app/config/server.ts
+++ b/app/config/server.ts
@@ -12,7 +12,8 @@ declare global {
DISABLE_GPT4?: string; // allow user to use gpt-4 or not
BUILD_MODE?: "standalone" | "export";
BUILD_APP?: string; // is building desktop app
- HIDE_BALANCE_QUERY?: string; // allow user to query balance or not
+ ENABLE_BALANCE_QUERY?: string; // allow user to query balance or not
+ DISABLE_FAST_LINK?: string; // disallow parse settings from url or not
}
}
}
@@ -47,6 +48,7 @@ export const getServerSideConfig = () => {
isVercel: !!process.env.VERCEL,
hideUserApiKey: !!process.env.HIDE_USER_API_KEY,
disableGPT4: !!process.env.DISABLE_GPT4,
- hideBalanceQuery: !!process.env.HIDE_BALANCE_QUERY,
+ hideBalanceQuery: !process.env.ENABLE_BALANCE_QUERY,
+ disableFastLink: !!process.env.DISABLE_FAST_LINK,
};
};
diff --git a/app/constant.ts b/app/constant.ts
index e03e00971..8d36e0b55 100644
--- a/app/constant.ts
+++ b/app/constant.ts
@@ -10,6 +10,7 @@ export const RUNTIME_CONFIG_DOM = "danger-runtime-config";
export const DEFAULT_CORS_HOST = "https://ab.nextweb.fun";
export const DEFAULT_API_HOST = `${DEFAULT_CORS_HOST}/api/proxy`;
+export const OPENAI_BASE_URL = "https://api.openai.com";
export enum Path {
Home = "/",
@@ -69,12 +70,20 @@ export const OpenaiPath = {
export const DEFAULT_INPUT_TEMPLATE = `{{input}}`; // input / time / model / lang
export const DEFAULT_SYSTEM_TEMPLATE = `
You are ChatGPT, a large language model trained by OpenAI.
-Knowledge cutoff: 2021-09
+Knowledge cutoff: {{cutoff}}
Current model: {{model}}
-Current time: {{time}}`;
+Current time: {{time}}
+`;
export const SUMMARIZE_MODEL = "gpt-3.5-turbo";
+export const KnowledgeCutOffDate: Record = {
+ default: "2021-09",
+ "gpt-3.5-turbo-1106": "2023-04",
+ "gpt-4-1106-preview": "2023-04",
+ "gpt-4-vision-preview": "2023-04",
+};
+
export const DEFAULT_MODELS = [
{
name: "gpt-4",
@@ -100,6 +109,14 @@ export const DEFAULT_MODELS = [
name: "gpt-4-32k-0613",
available: true,
},
+ {
+ name: "gpt-4-1106-preview",
+ available: true,
+ },
+ {
+ name: "gpt-4-vision-preview",
+ available: true,
+ },
{
name: "gpt-3.5-turbo",
available: true,
@@ -112,6 +129,10 @@ export const DEFAULT_MODELS = [
name: "gpt-3.5-turbo-0613",
available: true,
},
+ {
+ name: "gpt-3.5-turbo-1106",
+ available: true,
+ },
{
name: "gpt-3.5-turbo-16k",
available: true,
diff --git a/app/store/access.ts b/app/store/access.ts
index 9eaa81e5e..3d889f6e7 100644
--- a/app/store/access.ts
+++ b/app/store/access.ts
@@ -16,6 +16,7 @@ const DEFAULT_ACCESS_STATE = {
hideUserApiKey: false,
hideBalanceQuery: false,
disableGPT4: false,
+ disableFastLink: false,
openaiUrl: DEFAULT_OPENAI_URL,
};
@@ -29,15 +30,6 @@ export const useAccessStore = createPersistStore(
return get().needCode;
},
- updateCode(code: string) {
- set(() => ({ accessCode: code?.trim() }));
- },
- updateToken(token: string) {
- set(() => ({ token: token?.trim() }));
- },
- updateOpenAiUrl(url: string) {
- set(() => ({ openaiUrl: url?.trim() }));
- },
isAuthorized() {
this.fetch();
diff --git a/app/store/chat.ts b/app/store/chat.ts
index 56ac8db6c..95822c191 100644
--- a/app/store/chat.ts
+++ b/app/store/chat.ts
@@ -7,6 +7,7 @@ import { createEmptyMask, Mask } from "./mask";
import {
DEFAULT_INPUT_TEMPLATE,
DEFAULT_SYSTEM_TEMPLATE,
+ KnowledgeCutOffDate,
StoreKey,
SUMMARIZE_MODEL,
} from "../constant";
@@ -116,7 +117,11 @@ function countMessages(msgs: ChatMessage[]) {
}
function fillTemplateWith(input: string, modelConfig: ModelConfig) {
+ let cutoff =
+ KnowledgeCutOffDate[modelConfig.model] ?? KnowledgeCutOffDate.default;
+
const vars = {
+ cutoff,
model: modelConfig.model,
time: new Date().toLocaleString(),
lang: getLang(),
diff --git a/app/store/config.ts b/app/store/config.ts
index 184355c94..0fbc26dfe 100644
--- a/app/store/config.ts
+++ b/app/store/config.ts
@@ -133,7 +133,9 @@ export const useAppConfig = createPersistStore(
.customModels.split(",")
.filter((v) => !!v && v.length > 0)
.map((m) => ({ name: m, available: true }));
- return get().models.concat(customModels);
+ const allModels = get().models.concat(customModels);
+ allModels.sort((a, b) => (a.name < b.name ? -1 : 1));
+ return allModels;
},
}),
{
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index e530203f6..649e3816d 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -9,7 +9,7 @@
},
"package": {
"productName": "ChatGPT Next Web",
- "version": "2.9.9"
+ "version": "2.9.10"
},
"tauri": {
"allowlist": {