(input: string)
| 132 | }; |
| 133 | |
| 134 | const callPromptService = (input: string) => { |
| 135 | prompt.action({ |
| 136 | input, |
| 137 | callback: (result) => { |
| 138 | const response: ChatMessage = { |
| 139 | id: (Date.now() + 1).toString(), |
| 140 | content: result.output, |
| 141 | sender: 'robot', |
| 142 | timestamp: new Date(), |
| 143 | }; |
| 144 | setIsTyping(false); |
| 145 | setMessages((prev) => [...prev, response]); |
| 146 | moveChatToBottom(); |
| 147 | }, |
| 148 | failedCallback: (error?: string) => { |
| 149 | console.error(error); |
| 150 | setIsTyping(false); |
| 151 | setDisableInput(true); |
| 152 | }, |
| 153 | }); |
| 154 | }; |
| 155 | |
| 156 | return ( |
| 157 | <div className="w-full h-full flex flex-col overflow-hidden"> |
no test coverage detected