File tree Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export type ModelInfo = {
1414 * @stored
1515 */
1616
17- enum InferenceEngine {
17+ export enum InferenceEngine {
1818 nitro = 'nitro' ,
1919 openai = 'openai' ,
2020 triton_trtllm = 'triton_trtllm' ,
Original file line number Diff line number Diff line change 11import { useEffect , useState } from 'react'
22
3- import { Model } from '@janhq/core'
3+ import { InferenceEngine , Model } from '@janhq/core'
44import {
55 Button ,
66 Select ,
@@ -41,7 +41,14 @@ export default function DropdownListSidebar() {
4141
4242 useEffect ( ( ) => {
4343 getDownloadedModels ( ) . then ( ( downloadedModels ) => {
44- setDownloadedModels ( downloadedModels )
44+ setDownloadedModels (
45+ downloadedModels . sort ( ( a , b ) =>
46+ a . engine !== InferenceEngine . nitro &&
47+ b . engine === InferenceEngine . nitro
48+ ? 1
49+ : - 1
50+ )
51+ )
4552 if ( downloadedModels . length > 0 ) {
4653 setSelected (
4754 downloadedModels . filter (
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Fragment } from 'react'
22
33import ScrollToBottom from 'react-scroll-to-bottom'
44
5+ import { InferenceEngine } from '@janhq/core'
56import { Button } from '@janhq/uikit'
67import { useAtomValue } from 'jotai'
78
@@ -41,6 +42,10 @@ const ChatBody: React.FC = () => {
4142 </ div >
4243 )
4344
45+ const showOnboardingStep =
46+ downloadedModels . filter ( ( e ) => e . engine === InferenceEngine . nitro )
47+ . length === 0
48+
4449 return (
4550 < Fragment >
4651 { messages . length === 0 ? (
@@ -50,7 +55,24 @@ const ChatBody: React.FC = () => {
5055 width = { 56 }
5156 height = { 56 }
5257 />
53- < p className = "mt-1 text-base font-medium" > How can I help you?</ p >
58+ { showOnboardingStep ? (
59+ < >
60+ < p className = "mt-1 text-base font-medium" >
61+ { `You don't have a local model yet.` }
62+ </ p >
63+ < div className = "w-auto px-4 py-2" >
64+ < Button
65+ block
66+ className = "bg-blue-100 font-bold text-blue-600 hover:bg-blue-100 hover:text-blue-600"
67+ onClick = { ( ) => setMainViewState ( MainViewState . Hub ) }
68+ >
69+ Explore The Hub
70+ </ Button >
71+ </ div >
72+ </ >
73+ ) : (
74+ < p className = "mt-1 text-base font-medium" > How can I help you?</ p >
75+ ) }
5476 </ div >
5577 ) : (
5678 < ScrollToBottom className = "flex h-full w-full flex-col" >
You can’t perform that action at this time.
0 commit comments