| 1280 | } |
| 1281 | |
| 1282 | const downloadFile = async (fileAnnotation) => { |
| 1283 | try { |
| 1284 | const response = await axios.post( |
| 1285 | `${baseURL}/api/v1/openai-assistants-file/download`, |
| 1286 | { fileName: fileAnnotation.fileName, chatflowId: chatflowid, chatId: chatId }, |
| 1287 | { responseType: 'blob' } |
| 1288 | ) |
| 1289 | const blob = new Blob([response.data], { type: response.headers['content-type'] }) |
| 1290 | const downloadUrl = window.URL.createObjectURL(blob) |
| 1291 | const link = document.createElement('a') |
| 1292 | link.href = downloadUrl |
| 1293 | link.download = fileAnnotation.fileName |
| 1294 | document.body.appendChild(link) |
| 1295 | link.click() |
| 1296 | link.remove() |
| 1297 | } catch (error) { |
| 1298 | console.error('Download failed:', error) |
| 1299 | } |
| 1300 | } |
| 1301 | |
| 1302 | const getAgentIcon = (nodeName, instructions) => { |
| 1303 | if (nodeName) { |