mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-26 07:30:18 +09:00
feat: #168
This commit is contained in:
parent
8363fd26c5
commit
f676aa19af
@ -232,6 +232,13 @@ Azure 密钥。
|
|||||||
|
|
||||||
Azure Api 版本,你可以在这里找到:[Azure 文档](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions)。
|
Azure Api 版本,你可以在这里找到:[Azure 文档](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions)。
|
||||||
|
|
||||||
|
### `NEXT_PUBLIC_DISABLE_AUTOGENERATETITLE` (可选)
|
||||||
|
|
||||||
|
如果你不想让用户使用自动生成标题功能,将此环境变量设置为 1 即可。
|
||||||
|
|
||||||
|
### `NEXT_PUBLIC_DISABLE_SENDMEMORY` (可选)
|
||||||
|
|
||||||
|
如果你不想让用户使用历史摘要功能,将此环境变量设置为 1 即可。
|
||||||
|
|
||||||
## 部署
|
## 部署
|
||||||
|
|
||||||
|
@ -208,7 +208,11 @@ export function ModelConfigList(props: {
|
|||||||
<ListItem title={Locale.Memory.Title} subTitle={Locale.Memory.Send}>
|
<ListItem title={Locale.Memory.Title} subTitle={Locale.Memory.Send}>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={props.modelConfig.sendMemory}
|
disabled={!!process.env.NEXT_PUBLIC_DISABLE_SENDMEMORY}
|
||||||
|
checked={
|
||||||
|
!process.env.NEXT_PUBLIC_DISABLE_SENDMEMORY &&
|
||||||
|
props.modelConfig.sendMemory
|
||||||
|
}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
props.updateConfig(
|
props.updateConfig(
|
||||||
(config) => (config.sendMemory = e.currentTarget.checked),
|
(config) => (config.sendMemory = e.currentTarget.checked),
|
||||||
|
@ -801,7 +801,11 @@ export function Settings() {
|
|||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={config.enableAutoGenerateTitle}
|
disabled={!!process.env.NEXT_PUBLIC_DISABLE_AUTOGENERATETITLE}
|
||||||
|
checked={
|
||||||
|
!process.env.NEXT_PUBLIC_DISABLE_AUTOGENERATETITLE &&
|
||||||
|
config.enableAutoGenerateTitle
|
||||||
|
}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
updateConfig(
|
updateConfig(
|
||||||
(config) =>
|
(config) =>
|
||||||
|
@ -608,6 +608,7 @@ export const useChatStore = createPersistStore(
|
|||||||
// should summarize topic after chating more than 50 words
|
// should summarize topic after chating more than 50 words
|
||||||
const SUMMARIZE_MIN_LEN = 50;
|
const SUMMARIZE_MIN_LEN = 50;
|
||||||
if (
|
if (
|
||||||
|
!process.env.NEXT_PUBLIC_DISABLE_AUTOGENERATETITLE &&
|
||||||
config.enableAutoGenerateTitle &&
|
config.enableAutoGenerateTitle &&
|
||||||
session.topic === DEFAULT_TOPIC &&
|
session.topic === DEFAULT_TOPIC &&
|
||||||
countMessages(messages) >= SUMMARIZE_MIN_LEN
|
countMessages(messages) >= SUMMARIZE_MIN_LEN
|
||||||
@ -662,6 +663,7 @@ export const useChatStore = createPersistStore(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
!process.env.NEXT_PUBLIC_DISABLE_SENDMEMORY &&
|
||||||
historyMsgLength > modelConfig.compressMessageLengthThreshold &&
|
historyMsgLength > modelConfig.compressMessageLengthThreshold &&
|
||||||
modelConfig.sendMemory
|
modelConfig.sendMemory
|
||||||
) {
|
) {
|
||||||
|
Loading…
Reference in New Issue
Block a user