forked from XiaoMo/ChatGPT-Next-Web
dev: 增加模型设置项:是否启用注入全局 System Prompt 功能
This commit is contained in:
parent
c7e9f13d2e
commit
5e361f6748
@ -130,6 +130,22 @@ export function ModelConfigList(props: {
|
||||
></InputRange>
|
||||
</ListItem>
|
||||
|
||||
<ListItem
|
||||
title={Locale.Settings.InjectSystemPrompts.Title}
|
||||
subTitle={Locale.Settings.InjectSystemPrompts.SubTitle}
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={props.modelConfig.enableInjectSystemPrompts}
|
||||
onChange={(e) =>
|
||||
props.updateConfig(
|
||||
(config) =>
|
||||
(config.enableInjectSystemPrompts = e.currentTarget.checked),
|
||||
)
|
||||
}
|
||||
></input>
|
||||
</ListItem>
|
||||
|
||||
<ListItem
|
||||
title={Locale.Settings.InputTemplate.Title}
|
||||
subTitle={Locale.Settings.InputTemplate.SubTitle}
|
||||
|
@ -139,7 +139,10 @@ const cn = {
|
||||
Title: "字体大小",
|
||||
SubTitle: "聊天内容的字体大小",
|
||||
},
|
||||
|
||||
InjectSystemPrompts: {
|
||||
Title: "注入系统级提示信息",
|
||||
SubTitle: "强制给每次请求的消息列表开头添加一个系统级提示",
|
||||
},
|
||||
InputTemplate: {
|
||||
Title: "用户输入预处理",
|
||||
SubTitle: "用户最新的一条消息会填充到此模板",
|
||||
|
@ -47,6 +47,7 @@ export const DEFAULT_CONFIG = {
|
||||
sendMemory: true,
|
||||
historyMessageCount: 4,
|
||||
compressMessageLengthThreshold: 1000,
|
||||
enableInjectSystemPrompts: true,
|
||||
template: DEFAULT_INPUT_TEMPLATE,
|
||||
},
|
||||
};
|
||||
@ -146,7 +147,7 @@ export const useAppConfig = create<ChatConfigStore>()(
|
||||
}),
|
||||
{
|
||||
name: StoreKey.Config,
|
||||
version: 3.5,
|
||||
version: 3.6,
|
||||
migrate(persistedState, version) {
|
||||
const state = persistedState as ChatConfig;
|
||||
|
||||
@ -165,6 +166,10 @@ export const useAppConfig = create<ChatConfigStore>()(
|
||||
state.customModels = "claude,claude-100k";
|
||||
}
|
||||
|
||||
if (version < 3.6) {
|
||||
state.modelConfig.enableInjectSystemPrompts = true;
|
||||
}
|
||||
|
||||
return state as any;
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user