mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-24 22:50:22 +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)。
|
||||
|
||||
### `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}>
|
||||
<input
|
||||
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) =>
|
||||
props.updateConfig(
|
||||
(config) => (config.sendMemory = e.currentTarget.checked),
|
||||
|
@ -801,7 +801,11 @@ export function Settings() {
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={config.enableAutoGenerateTitle}
|
||||
disabled={!!process.env.NEXT_PUBLIC_DISABLE_AUTOGENERATETITLE}
|
||||
checked={
|
||||
!process.env.NEXT_PUBLIC_DISABLE_AUTOGENERATETITLE &&
|
||||
config.enableAutoGenerateTitle
|
||||
}
|
||||
onChange={(e) =>
|
||||
updateConfig(
|
||||
(config) =>
|
||||
|
@ -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
|
||||
) {
|
||||
|
Loading…
Reference in New Issue
Block a user