()
| 38 | useStartAssistant(assistantId, chatManager, initialThreadMessage); |
| 39 | |
| 40 | const startChatAssistant = async () => { |
| 41 | setIsButtonDisabled(true); |
| 42 | setStartLoading(true); |
| 43 | if (chatManager) { |
| 44 | try { |
| 45 | console.log('Starting assistant with the following parameters:'); |
| 46 | console.log('Assistant Name:', assistantName); |
| 47 | console.log('Assistant Model:', assistantModel); |
| 48 | console.log('Assistant Description:', assistantDescription); |
| 49 | console.log('File IDs:', fileIds); |
| 50 | console.log('Initial Thread Message:', initialThreadMessage); |
| 51 | |
| 52 | await chatManager.startAssistant({ assistantName, assistantModel, assistantDescription }, fileIds, initialThreadMessage); |
| 53 | |
| 54 | console.log('Assistant started:', chatManager.getChatState()); |
| 55 | setChatStarted(true); |
| 56 | } catch (error) { |
| 57 | console.error('Error starting assistant:', error); |
| 58 | if (error instanceof Error) setStatusMessage(`Error: ${error.message}`); |
| 59 | } finally { |
| 60 | setIsButtonDisabled(false); |
| 61 | setStartLoading(false); |
| 62 | } |
| 63 | } |
| 64 | }; |
| 65 | |
| 66 | return ( |
| 67 | <main className="flex flex-col items-center justify-between pb-40 bg-space-grey-light"> |
nothing calls this directly
no test coverage detected