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:
parent
010802012f
commit
144b836935
@ -13,7 +13,7 @@ export default defineConfig([
|
|||||||
NODE: JSON.stringify(`${pkgJson.name}/${pkgJson.node}`),
|
NODE: JSON.stringify(`${pkgJson.name}/${pkgJson.node}`),
|
||||||
API_URL: JSON.stringify('http://127.0.0.1:39291'),
|
API_URL: JSON.stringify('http://127.0.0.1:39291'),
|
||||||
SOCKET_URL: JSON.stringify('ws://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_ENGINES: JSON.stringify(engines),
|
||||||
DEFAULT_REMOTE_MODELS: JSON.stringify(models),
|
DEFAULT_REMOTE_MODELS: JSON.stringify(models),
|
||||||
},
|
},
|
||||||
@ -26,7 +26,7 @@ export default defineConfig([
|
|||||||
file: 'dist/node/index.cjs.js',
|
file: 'dist/node/index.cjs.js',
|
||||||
},
|
},
|
||||||
define: {
|
define: {
|
||||||
CORTEX_ENGINE_VERSION: JSON.stringify('v0.1.46'),
|
CORTEX_ENGINE_VERSION: JSON.stringify('v0.1.49'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -111,7 +111,7 @@ export default defineConfig([
|
|||||||
SETTINGS: JSON.stringify(defaultSettingJson),
|
SETTINGS: JSON.stringify(defaultSettingJson),
|
||||||
CORTEX_API_URL: JSON.stringify('http://127.0.0.1:39291'),
|
CORTEX_API_URL: JSON.stringify('http://127.0.0.1:39291'),
|
||||||
CORTEX_SOCKET_URL: JSON.stringify('ws://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'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -28,6 +28,8 @@ import ModelLabel from '@/containers/ModelLabel'
|
|||||||
|
|
||||||
import SetupRemoteModel from '@/containers/SetupRemoteModel'
|
import SetupRemoteModel from '@/containers/SetupRemoteModel'
|
||||||
|
|
||||||
|
import { useActiveModel } from '@/hooks/useActiveModel'
|
||||||
|
|
||||||
import { useCreateNewThread } from '@/hooks/useCreateNewThread'
|
import { useCreateNewThread } from '@/hooks/useCreateNewThread'
|
||||||
import useDownloadModel from '@/hooks/useDownloadModel'
|
import useDownloadModel from '@/hooks/useDownloadModel'
|
||||||
import { modelDownloadStateAtom } from '@/hooks/useDownloadState'
|
import { modelDownloadStateAtom } from '@/hooks/useDownloadState'
|
||||||
@ -93,6 +95,7 @@ const ModelDropdown = ({
|
|||||||
const { updateModelParameter } = useUpdateModelParameters()
|
const { updateModelParameter } = useUpdateModelParameters()
|
||||||
const searchInputRef = useRef<HTMLInputElement>(null)
|
const searchInputRef = useRef<HTMLInputElement>(null)
|
||||||
const configuredModels = useAtomValue(configuredModelsAtom)
|
const configuredModels = useAtomValue(configuredModelsAtom)
|
||||||
|
const { stopModel } = useActiveModel()
|
||||||
|
|
||||||
const featuredModels = configuredModels.filter(
|
const featuredModels = configuredModels.filter(
|
||||||
(x) =>
|
(x) =>
|
||||||
@ -226,6 +229,7 @@ const ModelDropdown = ({
|
|||||||
const model = downloadedModels.find((m) => m.id === modelId)
|
const model = downloadedModels.find((m) => m.id === modelId)
|
||||||
setSelectedModel(model)
|
setSelectedModel(model)
|
||||||
setOpen(false)
|
setOpen(false)
|
||||||
|
stopModel()
|
||||||
|
|
||||||
if (activeThread) {
|
if (activeThread) {
|
||||||
// Change assistand tools based on model support RAG
|
// Change assistand tools based on model support RAG
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user