Refactor document generation to output HTML format and update system instructions for clarity

This commit is contained in:
MikeHughes-BIN
2025-12-15 13:53:14 +01:00
parent 1e38cc79f4
commit ec57411992
4 changed files with 93 additions and 33 deletions
+3 -3
View File
@@ -50,7 +50,7 @@ const module_exports = {
body: JSON.stringify({
model: "openai-gpt-oss-120b",
messages: [
{ role: "system", content: "You are a helpful assistant that generates documents from transcripts." },
{ role: "system", content: "You are a helpful assistant that generates HTML documents from transcripts. Output only valid HTML content without any preamble, explanations, or markdown formatting." },
{ role: "user", content: promptText }
],
temperature: 0
@@ -71,7 +71,7 @@ const module_exports = {
let inputTranscriptName = path.basename(transcriptPath, path.extname(transcriptPath)); // Name for the output file
console.log(inputTranscriptName);
const outPath = path.join(outputDir, `${inputTranscriptName}.md`); // Output file path & name to make naming dynamic. Pulled from input transcript name
const outPath = path.join(outputDir, `${inputTranscriptName}.html`); // Output file path & name to make naming dynamic. Pulled from input transcript name
fs.writeFileSync(outPath, output, "utf8"); // Write output to file
console.log("Generated document written to:", outPath);
@@ -91,7 +91,7 @@ if (require.main === module) {
if (args.length < 2) {
console.error("Usage: node llm-openai-gpt.js <transcriptPath> <documentTypePath> [language]");
console.error("Example: node llm-openai-gpt.js ./transcript.json ./docType.json de");
console.error("Example: node llm-openai-gpt.js ./transcript.json ./docType.txt de");
process.exit(1);
}