feat: option to enable web mode history (#311)

This commit is contained in:
josc146
2023-05-08 16:05:25 +08:00
parent 69b4c19002
commit e6cc1fec3c
6 changed files with 22 additions and 4 deletions
+2 -1
View File
@@ -112,5 +112,6 @@
"API Params": "API Params",
"API Url": "API Url",
"Others": "Others",
"API Modes": "API Modes"
"API Modes": "API Modes",
"Disable web mode history for better privacy protection, but it will result in unavailable conversations after a period of time": "Disable web mode history for better privacy protection, but it will result in unavailable conversations after a period of time"
}
+2 -1
View File
@@ -112,5 +112,6 @@
"API Params": "API参数",
"API Url": "API地址",
"Others": "其他",
"API Modes": "API模式"
"API Modes": "API模式",
"Disable web mode history for better privacy protection, but it will result in unavailable conversations after a period of time": "禁用网页版模式历史记录以获得更好的隐私保护, 但会导致对话在一段时间后不可用"
}
+2 -1
View File
@@ -112,5 +112,6 @@
"API Params": "API參數",
"API Url": "API網址",
"Others": "其他",
"API Modes": "API模式"
"API Modes": "API模式",
"Disable web mode history for better privacy protection, but it will result in unavailable conversations after a period of time": "禁用網頁版模式歷史記錄以獲得更好的隱私保護, 但會導致對話在壹段時間後不可用"
}
+1
View File
@@ -109,6 +109,7 @@ export const defaultConfig = {
customChatGptWebApiUrl: 'https://chat.openai.com',
customChatGptWebApiPath: '/backend-api/conversation',
customOpenAiApiUrl: 'https://api.openai.com',
disableWebModeHistory: true,
siteRegex: 'match nothing',
useSiteRegexOnly: false,
inputQuery: '',
+14
View File
@@ -116,6 +116,20 @@ function Others({ config, updateConfig }) {
return (
<>
<label>
<input
type="checkbox"
checked={config.disableWebModeHistory}
onChange={(e) => {
const checked = e.target.checked
updateConfig({ disableWebModeHistory: checked })
}}
/>
{t(
'Disable web mode history for better privacy protection, but it will result in unavailable conversations after a period of time',
)}
</label>
<br />
<label>
{t('Custom Site Regex')}
<input
+1 -1
View File
@@ -111,7 +111,7 @@ export async function generateAnswersWithChatgptWebApi(port, question, session,
parent_message_id: session.parentMessageId,
timezone_offset_min: new Date().getTimezoneOffset(),
variant_purpose: 'none',
history_and_training_disabled: true,
history_and_training_disabled: config.disableWebModeHistory,
}),
onMessage(message) {
console.debug('sse message', message)