mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-10 20:16:37 +08:00
Merge branch 'Yidadaa:main' into main
This commit is contained in:
commit
175c596169
@ -102,7 +102,7 @@ We recommend that you follow the steps below to re-deploy:
|
|||||||
|
|
||||||
### Enable Automatic Updates
|
### Enable Automatic Updates
|
||||||
|
|
||||||
After forking the project, due to the limitations imposed by Github, you need to manually enable Workflows and Upstream Sync Action on the Actions page of the forked project. Once enabled, automatic updates will be scheduled every hour:
|
After forking the project, due to the limitations imposed by GitHub, you need to manually enable Workflows and Upstream Sync Action on the Actions page of the forked project. Once enabled, automatic updates will be scheduled every hour:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -110,7 +110,7 @@ After forking the project, due to the limitations imposed by Github, you need to
|
|||||||
|
|
||||||
### Manually Updating Code
|
### Manually Updating Code
|
||||||
|
|
||||||
If you want to update instantly, you can check out the [Github documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) to learn how to synchronize a forked project with upstream code.
|
If you want to update instantly, you can check out the [GitHub documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) to learn how to synchronize a forked project with upstream code.
|
||||||
|
|
||||||
You can star or watch this project or follow author to get release notifictions in time.
|
You can star or watch this project or follow author to get release notifictions in time.
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ const tw: LocaleType = {
|
|||||||
Chat: {
|
Chat: {
|
||||||
SubTitle: (count: number) => `您已經與 ChatGPT 進行了 ${count} 條對話`,
|
SubTitle: (count: number) => `您已經與 ChatGPT 進行了 ${count} 條對話`,
|
||||||
Actions: {
|
Actions: {
|
||||||
ChatList: "查看消息列表",
|
ChatList: "查看訊息列表",
|
||||||
CompressedHistory: "查看壓縮後的歷史 Prompt",
|
CompressedHistory: "查看壓縮後的歷史 Prompt",
|
||||||
Export: "匯出聊天紀錄",
|
Export: "匯出聊天紀錄",
|
||||||
Copy: "複製",
|
Copy: "複製",
|
||||||
@ -32,10 +32,10 @@ const tw: LocaleType = {
|
|||||||
Send: "發送",
|
Send: "發送",
|
||||||
},
|
},
|
||||||
Export: {
|
Export: {
|
||||||
Title: "匯出聊天記錄為 Markdown",
|
Title: "將聊天記錄匯出為 Markdown",
|
||||||
Copy: "複製全部",
|
Copy: "複製全部",
|
||||||
Download: "下載檔案",
|
Download: "下載檔案",
|
||||||
MessageFromYou: "來自你的訊息",
|
MessageFromYou: "來自您的訊息",
|
||||||
MessageFromChatGPT: "來自 ChatGPT 的訊息",
|
MessageFromChatGPT: "來自 ChatGPT 的訊息",
|
||||||
},
|
},
|
||||||
Memory: {
|
Memory: {
|
||||||
@ -43,8 +43,8 @@ const tw: LocaleType = {
|
|||||||
EmptyContent: "尚未記憶",
|
EmptyContent: "尚未記憶",
|
||||||
Copy: "複製全部",
|
Copy: "複製全部",
|
||||||
Send: "發送記憶",
|
Send: "發送記憶",
|
||||||
Reset: "重置對話",
|
Reset: "重設對話",
|
||||||
ResetConfirm: "重置後將清空當前對話記錄以及歷史記憶,確認重置?",
|
ResetConfirm: "重設後將清除目前對話記錄以及歷史記憶,確認重設?",
|
||||||
},
|
},
|
||||||
Home: {
|
Home: {
|
||||||
NewChat: "新的對話",
|
NewChat: "新的對話",
|
||||||
@ -56,18 +56,18 @@ const tw: LocaleType = {
|
|||||||
Title: "設定",
|
Title: "設定",
|
||||||
SubTitle: "設定選項",
|
SubTitle: "設定選項",
|
||||||
Actions: {
|
Actions: {
|
||||||
ClearAll: "清除所有數據",
|
ClearAll: "清除所有資料",
|
||||||
ResetAll: "重置所有設定",
|
ResetAll: "重設所有設定",
|
||||||
Close: "關閉",
|
Close: "關閉",
|
||||||
ConfirmResetAll: {
|
ConfirmResetAll: {
|
||||||
Confirm: "Are you sure you want to reset all configurations?",
|
Confirm: "您確定要重設所有設定嗎?",
|
||||||
},
|
},
|
||||||
ConfirmClearAll: {
|
ConfirmClearAll: {
|
||||||
Confirm: "Are you sure you want to reset all chat?",
|
Confirm: "您確定要清除所有聊天嗎?",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Lang: {
|
Lang: {
|
||||||
Name: "Language",
|
Name: "語言",
|
||||||
Options: {
|
Options: {
|
||||||
cn: "简体中文",
|
cn: "简体中文",
|
||||||
en: "English",
|
en: "English",
|
||||||
@ -98,16 +98,16 @@ const tw: LocaleType = {
|
|||||||
SendPreviewBubble: "發送預覽氣泡",
|
SendPreviewBubble: "發送預覽氣泡",
|
||||||
Prompt: {
|
Prompt: {
|
||||||
Disable: {
|
Disable: {
|
||||||
Title: "停用提示詞自動補全",
|
Title: "停用提示詞自動補齊",
|
||||||
SubTitle: "在輸入框開頭輸入 / 即可觸發自動補全",
|
SubTitle: "在輸入框開頭輸入 / 即可觸發自動補齊",
|
||||||
},
|
},
|
||||||
List: "自定義提示詞列表",
|
List: "自定義提示詞列表",
|
||||||
ListCount: (builtin: number, custom: number) =>
|
ListCount: (builtin: number, custom: number) =>
|
||||||
`內置 ${builtin} 條,用戶定義 ${custom} 條`,
|
`內建 ${builtin} 條,用戶定義 ${custom} 條`,
|
||||||
Edit: "編輯",
|
Edit: "編輯",
|
||||||
Modal: {
|
Modal: {
|
||||||
Title: "提示詞列表",
|
Title: "提示詞列表",
|
||||||
Add: "增加一條",
|
Add: "新增一條",
|
||||||
Search: "搜尋提示詞",
|
Search: "搜尋提示詞",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -121,13 +121,13 @@ const tw: LocaleType = {
|
|||||||
},
|
},
|
||||||
Token: {
|
Token: {
|
||||||
Title: "API Key",
|
Title: "API Key",
|
||||||
SubTitle: "使用自己的 Key 可規避授權訪問限制",
|
SubTitle: "使用自己的 Key 可規避授權存取限制",
|
||||||
Placeholder: "OpenAI API Key",
|
Placeholder: "OpenAI API Key",
|
||||||
},
|
},
|
||||||
Usage: {
|
Usage: {
|
||||||
Title: "帳戶餘額",
|
Title: "帳戶餘額",
|
||||||
SubTitle(used: any, total: any) {
|
SubTitle(used: any, total: any) {
|
||||||
return `本月已使用 $${used},订阅总额 $${total}`;
|
return `本月已使用 $${used},訂閱總額 $${total}`;
|
||||||
},
|
},
|
||||||
IsChecking: "正在檢查…",
|
IsChecking: "正在檢查…",
|
||||||
Check: "重新檢查",
|
Check: "重新檢查",
|
||||||
@ -135,17 +135,17 @@ const tw: LocaleType = {
|
|||||||
},
|
},
|
||||||
AccessCode: {
|
AccessCode: {
|
||||||
Title: "授權碼",
|
Title: "授權碼",
|
||||||
SubTitle: "現在是未授權訪問狀態",
|
SubTitle: "目前是未授權存取狀態",
|
||||||
Placeholder: "請輸入授權碼",
|
Placeholder: "請輸入授權碼",
|
||||||
},
|
},
|
||||||
Model: "模型 (model)",
|
Model: "模型 (model)",
|
||||||
Temperature: {
|
Temperature: {
|
||||||
Title: "隨機性 (temperature)",
|
Title: "隨機性 (temperature)",
|
||||||
SubTitle: "值越大,回復越隨機",
|
SubTitle: "值越大,回應越隨機",
|
||||||
},
|
},
|
||||||
MaxTokens: {
|
MaxTokens: {
|
||||||
Title: "單次回復限制 (max_tokens)",
|
Title: "單次回應限制 (max_tokens)",
|
||||||
SubTitle: "單次交互所用的最大 Token 數",
|
SubTitle: "單次互動所用的最大 Token 數",
|
||||||
},
|
},
|
||||||
PresencePenlty: {
|
PresencePenlty: {
|
||||||
Title: "話題新穎度 (presence_penalty)",
|
Title: "話題新穎度 (presence_penalty)",
|
||||||
@ -164,16 +164,16 @@ const tw: LocaleType = {
|
|||||||
Summarize:
|
Summarize:
|
||||||
"Use the language used by the user (e.g. en-us for english conversation, zh-hant for chinese conversation, etc.) to summarise the conversation in at most 200 words. The summary will be used as prompt for you to continue the conversation in the future.",
|
"Use the language used by the user (e.g. en-us for english conversation, zh-hant for chinese conversation, etc.) to summarise the conversation in at most 200 words. The summary will be used as prompt for you to continue the conversation in the future.",
|
||||||
},
|
},
|
||||||
ConfirmClearAll: "確認清除所有對話、設定數據?",
|
ConfirmClearAll: "確認清除所有對話、設定?",
|
||||||
},
|
},
|
||||||
Copy: {
|
Copy: {
|
||||||
Success: "已複製到剪貼簿中",
|
Success: "已複製到剪貼簿中",
|
||||||
Failed: "複製失敗,請賦予剪貼簿權限",
|
Failed: "複製失敗,請賦予剪貼簿權限",
|
||||||
},
|
},
|
||||||
Context: {
|
Context: {
|
||||||
Toast: (x: any) => `已設置 ${x} 條前置上下文`,
|
Toast: (x: any) => `已設定 ${x} 條前置上下文`,
|
||||||
Edit: "前置上下文和歷史記憶",
|
Edit: "前置上下文和歷史記憶",
|
||||||
Add: "新增壹條",
|
Add: "新增一條",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10,10 +10,20 @@ const RAW_EN_URL = "f/awesome-chatgpt-prompts/main/prompts.csv";
|
|||||||
const EN_URL = MIRRORF_FILE_URL + RAW_EN_URL;
|
const EN_URL = MIRRORF_FILE_URL + RAW_EN_URL;
|
||||||
const FILE = "./public/prompts.json";
|
const FILE = "./public/prompts.json";
|
||||||
|
|
||||||
|
const timeoutPromise = (timeout) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
reject(new Error('Request timeout'));
|
||||||
|
}, timeout);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
async function fetchCN() {
|
async function fetchCN() {
|
||||||
console.log("[Fetch] fetching cn prompts...");
|
console.log("[Fetch] fetching cn prompts...");
|
||||||
try {
|
try {
|
||||||
const raw = await (await fetch(CN_URL)).json();
|
// const raw = await (await fetch(CN_URL)).json();
|
||||||
|
const response = await Promise.race([fetch(CN_URL), timeoutPromise(5000)]);
|
||||||
|
const raw = await response.json();
|
||||||
return raw.map((v) => [v.act, v.prompt]);
|
return raw.map((v) => [v.act, v.prompt]);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("[Fetch] failed to fetch cn prompts", error);
|
console.error("[Fetch] failed to fetch cn prompts", error);
|
||||||
@ -24,13 +34,15 @@ async function fetchCN() {
|
|||||||
async function fetchEN() {
|
async function fetchEN() {
|
||||||
console.log("[Fetch] fetching en prompts...");
|
console.log("[Fetch] fetching en prompts...");
|
||||||
try {
|
try {
|
||||||
const raw = await (await fetch(EN_URL)).text();
|
// const raw = await (await fetch(EN_URL)).text();
|
||||||
|
const response = await Promise.race([fetch(EN_URL), timeoutPromise(5000)]);
|
||||||
|
const raw = await response.text();
|
||||||
return raw
|
return raw
|
||||||
.split("\n")
|
.split("\n")
|
||||||
.slice(1)
|
.slice(1)
|
||||||
.map((v) => v.split('","').map((v) => v.replace('"', "")));
|
.map((v) => v.split('","').map((v) => v.replace('"', "")));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("[Fetch] failed to fetch cn prompts", error);
|
console.error("[Fetch] failed to fetch en prompts", error);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user