fix: update the condition for generating the title (#3702)
This commit is contained in:
parent
17be901d1a
commit
194093d95d
@ -14,12 +14,14 @@ import {
|
|||||||
ModelEvent,
|
ModelEvent,
|
||||||
Thread,
|
Thread,
|
||||||
EngineManager,
|
EngineManager,
|
||||||
|
InferenceEngine,
|
||||||
} from '@janhq/core'
|
} from '@janhq/core'
|
||||||
import { useAtomValue, useSetAtom } from 'jotai'
|
import { useAtomValue, useSetAtom } from 'jotai'
|
||||||
import { ulid } from 'ulidx'
|
import { ulid } from 'ulidx'
|
||||||
|
|
||||||
import { activeModelAtom, stateModelAtom } from '@/hooks/useActiveModel'
|
import { activeModelAtom, stateModelAtom } from '@/hooks/useActiveModel'
|
||||||
|
|
||||||
|
import { localEngines } from '@/utils/modelEngine'
|
||||||
import { extractInferenceParams } from '@/utils/modelParam'
|
import { extractInferenceParams } from '@/utils/modelParam'
|
||||||
|
|
||||||
import { extensionManager } from '@/extension'
|
import { extensionManager } from '@/extension'
|
||||||
@ -234,7 +236,11 @@ export default function EventHandler({ children }: { children: ReactNode }) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!activeModelRef.current) {
|
// Check model engine; we don't want to generate a title when it's not a local engine.
|
||||||
|
if (
|
||||||
|
!activeModelRef.current ||
|
||||||
|
!localEngines.includes(activeModelRef.current?.engine as InferenceEngine)
|
||||||
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user