fix: use model from model hub not load correct model in thread screen (#2368)

Signed-off-by: James <james@jan.ai>
Co-authored-by: James <james@jan.ai>
This commit is contained in:
NamH 2024-03-15 10:33:59 +07:00 committed by GitHub
parent 58e12f35c9
commit 3e27e97110
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,12 +74,16 @@ export const useCreateNewThread = () => {
const defaultModel = model ?? recommendedModel ?? downloadedModels[0] const defaultModel = model ?? recommendedModel ?? downloadedModels[0]
if (!model) {
// if we have model, which means user wants to create new thread from Model hub. Allow them.
// check last thread message, if there empty last message use can not create thread // check last thread message, if there empty last message use can not create thread
const lastMessage = threads[0]?.metadata?.lastMessage const lastMessage = threads[0]?.metadata?.lastMessage
if (!lastMessage && threads.length) { if (!lastMessage && threads.length) {
return null return null
} }
}
// modify assistant tools when experimental on, retieval toggle enabled in default // modify assistant tools when experimental on, retieval toggle enabled in default
const assistantTools: AssistantTool = { const assistantTools: AssistantTool = {