@@ -21,27 +21,27 @@ import { Close, Settings } from '@mui/icons-material'
21
21
import { SettingsModal } from './SettingsModal'
22
22
23
23
export const ChatV2 = ( ) => {
24
- const [ settingsModalOpen , setSettingsModalOpen ] = useState ( false )
25
24
const { courseId } = useParams ( )
26
-
27
25
const { course } = useCourse ( courseId )
26
+ const { infoTexts, isLoading : infoTextsLoading } = useInfoTexts ( )
27
+
28
28
const { userStatus, isLoading : statusLoading , refetch : refetchStatus } = useUserStatus ( courseId )
29
29
const [ model , setModel ] = useLocalStorageState < { name : string } > ( 'model-v2' , {
30
30
name : DEFAULT_MODEL ,
31
31
} )
32
- const { infoTexts, isLoading : infoTextsLoading } = useInfoTexts ( )
33
- const [ activePromptId , setActivePromptId ] = useState ( '' )
34
32
const [ system , setSystem ] = useLocalStorageState < { content : string } > ( 'general-chat-system' , { content : '' } )
35
33
const [ message , setMessage ] = useLocalStorageState < { content : string } > ( 'general-chat-current' , { content : '' } )
36
34
const [ messages , setMessages ] = useLocalStorageState < Message [ ] > ( 'general-chat-messages' , [ ] )
37
35
const [ prevResponse , setPrevResponse ] = useLocalStorageState < {
38
36
id : string
39
37
} > ( 'general-prev-response' , { id : '' } )
40
-
38
+
41
39
const appContainerRef = useContext ( AppContext )
42
40
const chatContainerRef = useRef < HTMLDivElement > ( null )
43
-
44
41
const inputFileRef = useRef < HTMLInputElement > ( null )
42
+
43
+ const [ settingsModalOpen , setSettingsModalOpen ] = useState ( false )
44
+ const [ activePromptId , setActivePromptId ] = useState ( '' )
45
45
const [ fileName , setFileName ] = useState < string > ( '' )
46
46
const [ completion , setCompletion ] = useState ( '' )
47
47
const [ streamController , setStreamController ] = useState < AbortController > ( )
@@ -50,8 +50,9 @@ export const ChatV2 = () => {
50
50
const [ tokenUsageWarning , setTokenUsageWarning ] = useState ( '' )
51
51
const [ tokenWarningVisible , setTokenWarningVisible ] = useState ( false )
52
52
const [ modelTemperature , setModelTemperature ] = useState ( 0.5 )
53
- const [ setRetryTimeout , clearRetryTimeout ] = useRetryTimeout ( )
54
53
const [ saveConsent , setSaveConsent ] = useState ( true )
54
+
55
+ const [ setRetryTimeout , clearRetryTimeout ] = useRetryTimeout ( )
55
56
56
57
const { t, i18n } = useTranslation ( )
57
58
const { language } = i18n
@@ -197,6 +198,8 @@ export const ChatV2 = () => {
197
198
} }
198
199
>
199
200
< SettingsModal open = { settingsModalOpen } setOpen = { setSettingsModalOpen } > </ SettingsModal >
201
+ < Box sx = { { display : 'flex' , justifyContent : 'space-between' } } >
202
+
200
203
< Box sx = { { display : 'flex' , gap : '1rem' } } >
201
204
{ disclaimerInfo && < Disclaimer disclaimer = { disclaimerInfo } /> }
202
205
< SystemPrompt content = { system . content } setContent = { ( content ) => setSystem ( { content } ) } />
@@ -205,6 +208,8 @@ export const ChatV2 = () => {
205
208
< Settings > </ Settings >
206
209
</ IconButton >
207
210
</ Box >
211
+ < Button variant = 'outlined' size = 'small' > Ohtu sandbox</ Button >
212
+ </ Box >
208
213
< Box ref = { chatContainerRef } >
209
214
< Conversation messages = { messages } completion = { completion } />
210
215
< ChatBox
0 commit comments