修复模型选择继承的小bug

This commit is contained in:
sijinhui
2024-07-12 11:28:32 +08:00
parent 90bbcc06d6
commit 37392d068c
5 changed files with 27 additions and 8 deletions

View File

@@ -224,14 +224,22 @@ export const useChatStore = createPersistStore(
});
},
newSession(mask?: Mask, currentModel?: Mask["modelConfig"]["model"]) {
newSession(
mask?: Mask,
currentModel?: Mask["modelConfig"]["model"],
currentProviderName?: ServiceProvider,
) {
const session = createEmptySession();
const config = useAppConfig.getState();
// console.log("------", session, "2222", config);
// 继承当前会话的模型
// 继承当前会话的模型,
// 新增继承模型提供者
if (currentModel) {
session.mask.modelConfig.model = currentModel;
}
if (currentProviderName) {
session.mask.modelConfig.providerName = currentProviderName;
}
if (mask) {
const config = useAppConfig.getState();
const globalModelConfig = config.modelConfig;