Commit b0d0782 1 parent fc5d581 commit b0d0782 Copy full SHA for b0d0782
File tree 2 files changed +4
-2
lines changed
components/customs/Main/Chat
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -39,9 +39,10 @@ function App() {
39
39
const msg = btnMsg || inputMsg ;
40
40
41
41
try {
42
- const myChatResponse = await waitAtLeast ( 1500 , sendUserChat ( msg ) ) ; // TODO: make it Generic
42
+ const myChatResponse = await waitAtLeast ( 1500 , sendUserChat ( msg ) ) as TypeResponseChat ; // TODO: make it Generic
43
+ if ( myChatResponse . errorMessage ) throw Error ( myChatResponse . errorMessage ) ;
43
44
if ( inputMsg ) addChat ( createReqChatFromMessage ( inputMsg ) ) ;
44
- addChat ( createMyChatFromResponse ( myChatResponse as TypeResponseChat ) ) ;
45
+ addChat ( createMyChatFromResponse ( myChatResponse ) ) ;
45
46
} catch ( error ) {
46
47
if ( inputMsg ) addChat ( createReqChatFromMessage ( inputMsg ) ) ;
47
48
addChat ( createMyChayChatFromError ( error ) ) ;
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export type TypeRequestChat = {
31
31
} ;
32
32
33
33
export type TypeResponseChat = {
34
+ errorMessage ?: string ;
34
35
messages ?: ( TypeImageResponseCardMessage | TypePlainTextMessage | TypeLoadingMessage ) [ ] ;
35
36
metadatas ?: { confidence : number } ;
36
37
} ;
You can’t perform that action at this time.
0 commit comments