mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-13 04:33:42 +08:00
feat: #168
This commit is contained in:
@@ -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
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user