fix: app does not reload model when prompt template is updated (#4537)

* fix: app does not reload model when prompt template is updated

* chore: lint fix
This commit is contained in:
Louis 2025-01-29 21:50:17 +07:00 committed by GitHub
parent 010802012f
commit 144b836935
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View File

@ -13,7 +13,7 @@ export default defineConfig([
NODE: JSON.stringify(`${pkgJson.name}/${pkgJson.node}`),
API_URL: JSON.stringify('http://127.0.0.1:39291'),
SOCKET_URL: JSON.stringify('ws://127.0.0.1:39291'),
CORTEX_ENGINE_VERSION: JSON.stringify('v0.1.46'),
CORTEX_ENGINE_VERSION: JSON.stringify('v0.1.49'),
DEFAULT_REMOTE_ENGINES: JSON.stringify(engines),
DEFAULT_REMOTE_MODELS: JSON.stringify(models),
},
@ -26,7 +26,7 @@ export default defineConfig([
file: 'dist/node/index.cjs.js',
},
define: {
CORTEX_ENGINE_VERSION: JSON.stringify('v0.1.46'),
CORTEX_ENGINE_VERSION: JSON.stringify('v0.1.49'),
},
},
{

View File

@ -111,7 +111,7 @@ export default defineConfig([
SETTINGS: JSON.stringify(defaultSettingJson),
CORTEX_API_URL: JSON.stringify('http://127.0.0.1:39291'),
CORTEX_SOCKET_URL: JSON.stringify('ws://127.0.0.1:39291'),
CORTEX_ENGINE_VERSION: JSON.stringify('v0.1.46'),
CORTEX_ENGINE_VERSION: JSON.stringify('v0.1.49'),
},
},
{

View File

@ -28,6 +28,8 @@ import ModelLabel from '@/containers/ModelLabel'
import SetupRemoteModel from '@/containers/SetupRemoteModel'
import { useActiveModel } from '@/hooks/useActiveModel'
import { useCreateNewThread } from '@/hooks/useCreateNewThread'
import useDownloadModel from '@/hooks/useDownloadModel'
import { modelDownloadStateAtom } from '@/hooks/useDownloadState'
@ -93,6 +95,7 @@ const ModelDropdown = ({
const { updateModelParameter } = useUpdateModelParameters()
const searchInputRef = useRef<HTMLInputElement>(null)
const configuredModels = useAtomValue(configuredModelsAtom)
const { stopModel } = useActiveModel()
const featuredModels = configuredModels.filter(
(x) =>
@ -226,6 +229,7 @@ const ModelDropdown = ({
const model = downloadedModels.find((m) => m.id === modelId)
setSelectedModel(model)
setOpen(false)
stopModel()
if (activeThread) {
// Change assistand tools based on model support RAG