@@ -3,7 +3,6 @@ import { PiPaperPlaneRight } from 'react-icons/pi'
33import { FiSettings } from 'react-icons/fi'
44import { LLMConfig } from 'electron/main/electron-store/storeConfig'
55import { AgentConfig , ToolDefinition , DatabaseSearchFilters } from '../../lib/llm/types'
6- import { Select , SelectContent , SelectItem , SelectTrigger , SelectValue } from '@/components/ui/select'
76import { Button } from '@/components/ui/button'
87import DbSearchFilters from './ChatConfigComponents/DBSearchFilters'
98import PromptEditor from './ChatConfigComponents/PromptEditor'
@@ -24,6 +23,7 @@ import exampleAgents from './ChatConfigComponents/exampleAgents'
2423import { allAvailableToolDefinitions } from '@/lib/llm/tools/tool-definitions'
2524import ToolSelector from './ChatConfigComponents/ToolSelector'
2625import SuggestionCard from '../ui/suggestion-card'
26+ import LLMSelectOrButton from '../Settings/LLMSettings/LLMSelectOrButton'
2727
2828interface StartChatProps {
2929 defaultModelName : string
@@ -36,9 +36,9 @@ const StartChat: React.FC<StartChatProps> = ({ defaultModelName, handleNewChatMe
3636 const [ userTextFieldInput , setUserTextFieldInput ] = useState < string > ( '' )
3737 const [ agentConfig , setAgentConfig ] = useState < AgentConfig > ( )
3838 const [ promptSuggestions ] = useState ( [
39- "What's the latest update on my project?" ,
39+ 'Generate a list of all the thoughts I have written on the topic of AGI' ,
4040 'Summarize my recent notes on machine learning' ,
41- 'Create a to-do list for today based on my calendar ' ,
41+ 'Based on what I wrote last week, which tasks should I focus on this week? ' ,
4242 ] )
4343
4444 useEffect ( ( ) => {
@@ -71,10 +71,6 @@ const StartChat: React.FC<StartChatProps> = ({ defaultModelName, handleNewChatMe
7171 handleNewChatMessage ( userTextFieldInput , { ...agentConfig } )
7272 }
7373
74- const handleLLMChange = ( value : string ) => {
75- setSelectedLLM ( value )
76- }
77-
7874 const handleToolsChange = ( tools : ToolDefinition [ ] ) => {
7975 setAgentConfig ( ( prevConfig ) => {
8076 if ( ! prevConfig ) throw new Error ( 'Agent config must be initialized before setting tools' )
@@ -114,9 +110,10 @@ const StartChat: React.FC<StartChatProps> = ({ defaultModelName, handleNewChatMe
114110 < div className = "flex w-full justify-center" >
115111 < img src = "icon.png" className = "size-16" alt = "ReorImage" />
116112 </ div >
117- < h1 className = "mb-10 text-[28px] text-foreground" >
118- Welcome to your AI-powered assistant! Start a conversation with your second brain!
119- </ h1 >
113+ < h1 className = "mb-0 text-[28px] text-foreground" > Welcome to your AI second brain.</ h1 >
114+ < p className = "mb-10 mt-1 text-muted-foreground" >
115+ Start a chat below. You can provide tools for the LLM to use and customize the system prompt below.{ ' ' }
116+ </ p >
120117 < div className = "flex w-full" >
121118 < div className = "mr-4" >
122119 < ToolSelector
@@ -144,18 +141,12 @@ const StartChat: React.FC<StartChatProps> = ({ defaultModelName, handleNewChatMe
144141 < div className = "mx-auto h-px w-[96%] bg-background/20" />
145142 < div className = "flex h-10 flex-col items-center justify-between gap-2 py-2 md:flex-row md:gap-4" >
146143 < div className = "flex flex-col items-center justify-between rounded-md border-0 py-2 md:flex-row" >
147- < Select value = { selectedLLM } onValueChange = { handleLLMChange } >
148- < SelectTrigger className = "m-2 w-32 border border-solid border-muted-foreground bg-transparent" >
149- < SelectValue placeholder = "Select LLM" />
150- </ SelectTrigger >
151- < SelectContent >
152- { llmConfigs . map ( ( llm ) => (
153- < SelectItem key = { llm . modelName } value = { llm . modelName } >
154- { llm . modelName }
155- </ SelectItem >
156- ) ) }
157- </ SelectContent >
158- </ Select >
144+ < LLMSelectOrButton
145+ llmConfigs = { llmConfigs }
146+ selectedLLM = { selectedLLM }
147+ setSelectedLLM = { setSelectedLLM }
148+ setLLMConfigs = { setLLMConfigs }
149+ />
159150 </ div >
160151 < div className = "flex items-center" >
161152 < Button
0 commit comments