Summarizer angepasst

This commit is contained in:
santa
2025-11-24 14:25:29 +01:00
parent b87bfd444d
commit 465fe8bd41
2 changed files with 5 additions and 2 deletions
@@ -1,4 +1,5 @@
const fs = require("fs"); const fs = require("fs");
const path = require("path");
// Prepare output directory (always storage/transcriptionSummaries under project root) // Prepare output directory (always storage/transcriptionSummaries under project root)
const outputDir = `${__dirname}/../../../storage/transcriptionSummaries`; const outputDir = `${__dirname}/../../../storage/transcriptionSummaries`;
@@ -6,6 +7,7 @@ if (!fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir, { recursive: true }); fs.mkdirSync(outputDir, { recursive: true });
} }
module.exports = { module.exports = {
name: "summarize-transcription", // Unique name for our function that will later be used to get the function from the map via "mapFunctions.get("example").function()" name: "summarize-transcription", // Unique name for our function that will later be used to get the function from the map via "mapFunctions.get("example").function()"
type: "summarizer", // value used to differentiate each module to order them in the UI type: "summarizer", // value used to differentiate each module to order them in the UI
@@ -32,7 +34,8 @@ module.exports = {
return { error: "Invalid JSON" }; return { error: "Invalid JSON" };
} }
} }
console.log(inputJson); // console.log(inputJson);
console.log(outputDir);
const words = inputJson.words; const words = inputJson.words;
if (!Array.isArray(words)) { if (!Array.isArray(words)) {
return { error: "No words Array found" }; return { error: "No words Array found" };
@@ -6,7 +6,7 @@ const inputJson = JSON.parse(fs.readFileSync("./testFile.json", "utf8"));
// Übergabe an den Summarizer // Übergabe an den Summarizer
transSummarizer.function({ transSummarizer.function({
inputJson: inputJson json: inputJson
}); });