mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-24 22:50:22 +09:00
fix(15): 修复插件功能支持模型判断逻辑
This commit is contained in:
parent
38c41f9ed3
commit
9a690dbcd0
@ -512,17 +512,18 @@ export function ChatActions(props: {
|
|||||||
icon={<RobotIcon />}
|
icon={<RobotIcon />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{config.pluginConfig.enable && !/03\d{2}$/.test(currentModel) && (
|
{config.pluginConfig.enable &&
|
||||||
<ChatAction
|
/^gpt(?!.*03\d{2}$).*$/.test(currentModel) && (
|
||||||
onClick={switchUsePlugins}
|
<ChatAction
|
||||||
text={
|
onClick={switchUsePlugins}
|
||||||
usePlugins
|
text={
|
||||||
? Locale.Chat.InputActions.DisablePlugins
|
usePlugins
|
||||||
: Locale.Chat.InputActions.EnablePlugins
|
? Locale.Chat.InputActions.DisablePlugins
|
||||||
}
|
: Locale.Chat.InputActions.EnablePlugins
|
||||||
icon={usePlugins ? <EnablePluginIcon /> : <DisablePluginIcon />}
|
}
|
||||||
/>
|
icon={usePlugins ? <EnablePluginIcon /> : <DisablePluginIcon />}
|
||||||
)}
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
{showModelSelector && (
|
{showModelSelector && (
|
||||||
<Selector
|
<Selector
|
||||||
@ -537,7 +538,7 @@ export function ChatActions(props: {
|
|||||||
chatStore.updateCurrentSession((session) => {
|
chatStore.updateCurrentSession((session) => {
|
||||||
session.mask.modelConfig.model = s[0] as ModelType;
|
session.mask.modelConfig.model = s[0] as ModelType;
|
||||||
session.mask.syncGlobalConfig = false;
|
session.mask.syncGlobalConfig = false;
|
||||||
session.mask.usePlugins = !/03\d{2}$/.test(
|
session.mask.usePlugins = /^gpt(?!.*03\d{2}$).*$/.test(
|
||||||
session.mask.modelConfig.model,
|
session.mask.modelConfig.model,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -38,8 +38,10 @@ export const createEmptyMask = () =>
|
|||||||
lang: getLang(),
|
lang: getLang(),
|
||||||
builtin: false,
|
builtin: false,
|
||||||
createdAt: Date.now(),
|
createdAt: Date.now(),
|
||||||
usePlugins: !/03\d{2}$/.test(useAppConfig.getState().modelConfig.model),
|
usePlugins: /^gpt(?!.*03\d{2}$).*$/.test(
|
||||||
} as Mask);
|
useAppConfig.getState().modelConfig.model,
|
||||||
|
),
|
||||||
|
}) as Mask;
|
||||||
|
|
||||||
export const useMaskStore = createPersistStore(
|
export const useMaskStore = createPersistStore(
|
||||||
{ ...DEFAULT_MASK_STATE },
|
{ ...DEFAULT_MASK_STATE },
|
||||||
@ -94,7 +96,7 @@ export const useMaskStore = createPersistStore(
|
|||||||
...config.modelConfig,
|
...config.modelConfig,
|
||||||
...m.modelConfig,
|
...m.modelConfig,
|
||||||
},
|
},
|
||||||
} as Mask),
|
}) as Mask,
|
||||||
);
|
);
|
||||||
return userMasks.concat(buildinMasks);
|
return userMasks.concat(buildinMasks);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user