Commit 71728fa5 authored by ali's avatar ali

feat: llm websocket 重写成 llm loop post

parent 19dfc9af
...@@ -118,6 +118,8 @@ export default class IPCs { ...@@ -118,6 +118,8 @@ export default class IPCs {
static initializeChildWindow(window: BrowserWindow) { static initializeChildWindow(window: BrowserWindow) {
ipcMain.on('fileUpload', async (event, path: string) => { ipcMain.on('fileUpload', async (event, path: string) => {
try {
const content = IPCs.readFile(path) const content = IPCs.readFile(path)
const formData = new FormData() const formData = new FormData()
const blob = new Blob([content], { type: 'audio/wav' }) const blob = new Blob([content], { type: 'audio/wav' })
...@@ -127,8 +129,11 @@ export default class IPCs { ...@@ -127,8 +129,11 @@ export default class IPCs {
method: 'POST', method: 'POST',
data: formData data: formData
}) })
window.webContents.send('msgReceivedFileUploadResponse', response) window.webContents.send('msgReceivedFileUploadResponse', response)
} catch (error) {
window.webContents.send('msgReceivedFileUploadResponse', { code: 500, message: JSON.stringify(error) })
}
}) })
} }
} }
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment