Commit 5c709afe by Archer Committed by GitHub

fix: model refresh (#6725)

parent 16b46c7d
---
title: 'V4.14.11(进行中)'
description: 'FastGPT V4.14.11 更新说明'
---
## 🚀 新增内容
## ⚙️ 优化
## 🐛 修复
1. 对话 Agent 模式,模型存在刷新后被重置问题。
\ No newline at end of file
......@@ -113,6 +113,7 @@ description: FastGPT 文档目录
- [/docs/self-host/upgrading/4-14/4140](/docs/self-host/upgrading/4-14/4140)
- [/docs/self-host/upgrading/4-14/4141](/docs/self-host/upgrading/4-14/4141)
- [/docs/self-host/upgrading/4-14/41410](/docs/self-host/upgrading/4-14/41410)
- [/docs/self-host/upgrading/4-14/41411](/docs/self-host/upgrading/4-14/41411)
- [/docs/self-host/upgrading/4-14/4142](/docs/self-host/upgrading/4-14/4142)
- [/docs/self-host/upgrading/4-14/4143](/docs/self-host/upgrading/4-14/4143)
- [/docs/self-host/upgrading/4-14/4144](/docs/self-host/upgrading/4-14/4144)
......
......@@ -173,8 +173,8 @@
"document/content/docs/self-host/custom-models/ollama.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/custom-models/xinference.en.mdx": "2026-03-30T10:05:42+08:00",
"document/content/docs/self-host/custom-models/xinference.mdx": "2026-03-30T10:05:42+08:00",
"document/content/docs/self-host/deploy/docker.en.mdx": "2026-03-31T23:15:29+08:00",
"document/content/docs/self-host/deploy/docker.mdx": "2026-04-02T10:04:45+08:00",
"document/content/docs/self-host/deploy/docker.en.mdx": "2026-04-02T23:10:34+08:00",
"document/content/docs/self-host/deploy/docker.mdx": "2026-04-02T23:10:34+08:00",
"document/content/docs/self-host/deploy/sealos.en.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/deploy/sealos.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/design/dataset.en.mdx": "2026-03-03T17:39:47+08:00",
......@@ -221,7 +221,7 @@
"document/content/docs/self-host/upgrading/4-14/4141.en.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/upgrading/4-14/4141.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/upgrading/4-14/41410.en.mdx": "2026-03-31T23:15:29+08:00",
"document/content/docs/self-host/upgrading/4-14/41410.mdx": "2026-04-01T13:34:01+08:00",
"document/content/docs/self-host/upgrading/4-14/41410.mdx": "2026-04-02T13:43:47+08:00",
"document/content/docs/self-host/upgrading/4-14/4142.en.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/upgrading/4-14/4142.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/upgrading/4-14/4143.en.mdx": "2026-03-03T17:39:47+08:00",
......@@ -241,7 +241,7 @@
"document/content/docs/self-host/upgrading/4-14/41481.en.mdx": "2026-03-09T12:02:02+08:00",
"document/content/docs/self-host/upgrading/4-14/41481.mdx": "2026-03-09T17:39:53+08:00",
"document/content/docs/self-host/upgrading/4-14/4149.en.mdx": "2026-03-23T12:17:04+08:00",
"document/content/docs/self-host/upgrading/4-14/4149.mdx": "2026-03-25T20:20:19+08:00",
"document/content/docs/self-host/upgrading/4-14/4149.mdx": "2026-04-07T21:01:52+08:00",
"document/content/docs/self-host/upgrading/outdated/40.en.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/upgrading/outdated/40.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/upgrading/outdated/41.en.mdx": "2026-03-03T17:39:47+08:00",
......
......@@ -29,27 +29,29 @@ const SettingLLMModel = ({
const model = defaultData.model;
const { modelSet, modelList } = useMemoEnhance(() => {
const { modelSet, modelList, defaultLLMModel } = useMemoEnhance(() => {
const modelSet = new Set<string>(llmModelList.map((item) => item.model));
return {
modelList: llmModelList,
modelSet
modelSet,
defaultLLMModel: getWebDefaultLLMModel(llmModelList).model
};
}, [llmModelList]);
// Set default model
const lastDefaultModel = useLatest(defaultModel);
useEffect(() => {
if (modelSet.size === 0) return;
if (!modelSet.has(model)) {
const defaultLLM = lastDefaultModel.current || getWebDefaultLLMModel(modelList).model;
if (defaultLLM) {
const defaultLLM = lastDefaultModel.current || defaultLLMModel;
if (defaultLLM && modelSet.has(defaultLLM)) {
onChange({
...defaultData,
model: defaultLLM
});
}
}
}, [modelList, model, defaultData]);
}, [model, defaultData, modelSet, defaultLLMModel]);
const {
isOpen: isOpenAIChatSetting,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment