fix: wait for model start

This commit is contained in:
Louis 2025-06-23 18:19:18 +07:00
parent 54691044d4
commit 5edc773535
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2

View File

@ -1,5 +1,10 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { AIEngine, EngineManager, SettingComponentProps } from '@janhq/core'
import {
AIEngine,
EngineManager,
SessionInfo,
SettingComponentProps,
} from '@janhq/core'
import { Model as CoreModel } from '@janhq/core'
// TODO: Replace this with the actual provider later
@ -138,8 +143,8 @@ export const stopAllModels = async () => {
export const startModel = async (
provider: ProviderObject,
model: string
): Promise<void> => {
getEngine(provider.provider)
): Promise<SessionInfo> => {
return getEngine(provider.provider)
.load(model)
.catch((error) => {
console.error(