Added functionality to group modules for frontend

This commit is contained in:
2025-11-24 12:53:05 +01:00
parent 05449ad8f2
commit 474e587ff2
2 changed files with 35 additions and 1 deletions
+34
View File
@@ -82,6 +82,28 @@ electron.app.whenReady().then(createWindow);
// mainWindow.webContents.send("fuck", "worked uwu")
// }, 5000);
electron.ipcMain.on("get_modules", async (event, args) => {
let module_array = {
"ai_modules":[],
"transcription_modules":[]
}
mapFunctions.forEach(e => {
switch(e.type){
case "llm":
module_array.ai_modules.push({"name": e.name, "displayname": e.displayname})
break;
case "transcription":
module_array.transcription_modules.push({"name": e.name, "displayname": e.displayname})
break;
}
})
console.log(module_array);
mainWindow.webContents.send("modules", module_array)
})
electron.ipcMain.on("file_submit", async (event, args) => {
try {
let curstep = 0
@@ -159,4 +181,16 @@ let q =
}
]
}
}
let q1 = {
"ai_modules": [
{name:"abc", displayname:"ABC"},
{name:"qeg", displayname:"aqghegahu"}
],
"transcription_modules": [
{name:"abc", displayname:"ABC"},
{name:"qeg", displayname:"aqghegahu"}
]
}
+1 -1
View File
@@ -1,6 +1,6 @@
module.exports = {
name:"chatgpt", // Unique name for our function that will later be used to get the function from the map via "mapFunctions.get("example").function()"
type:"document", // value used to differentiate each module to order them in the UI
type:"llm", // value used to differentiate each module to order them in the UI
displayname:"ChatGPT", // The displayname used within the UI
async function(parameter){
// TODO add code to actually send the transcript to ChatGPT and get a response back