diff --git a/README.md b/README.md index 6c42e66f3..e26f83f6f 100644 --- a/README.md +++ b/README.md @@ -232,6 +232,13 @@ Azure 密钥。 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 即可。 ## 部署 diff --git a/app/components/model-config.tsx b/app/components/model-config.tsx index e46a018f4..8ce082735 100644 --- a/app/components/model-config.tsx +++ b/app/components/model-config.tsx @@ -208,7 +208,11 @@ export function ModelConfigList(props: { props.updateConfig( (config) => (config.sendMemory = e.currentTarget.checked), diff --git a/app/components/settings.tsx b/app/components/settings.tsx index f7cc2d605..17bb60759 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -801,7 +801,11 @@ export function Settings() { > updateConfig( (config) => diff --git a/app/store/chat.ts b/app/store/chat.ts index 599aac42b..0e8326c36 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -608,6 +608,7 @@ export const useChatStore = createPersistStore( // should summarize topic after chating more than 50 words const SUMMARIZE_MIN_LEN = 50; if ( + !process.env.NEXT_PUBLIC_DISABLE_AUTOGENERATETITLE && config.enableAutoGenerateTitle && session.topic === DEFAULT_TOPIC && countMessages(messages) >= SUMMARIZE_MIN_LEN @@ -662,6 +663,7 @@ export const useChatStore = createPersistStore( ); if ( + !process.env.NEXT_PUBLIC_DISABLE_SENDMEMORY && historyMsgLength > modelConfig.compressMessageLengthThreshold && modelConfig.sendMemory ) {