feat: customPrompt piped through full generation chain

- generatePost: customPrompt или channel.ai_style_prompt → добавляется к userPrompt
- routes/generate.js: принимает customPrompt, передаёт в очередь
- workers/generation.js: передаёт customPrompt в generatePost и generateArticle
This commit is contained in:
Ник (Claude)
2026-06-11 15:15:22 +03:00
parent 1ef770b5fc
commit 08086650fc
3 changed files with 11 additions and 7 deletions
+3 -3
View File
@@ -15,7 +15,7 @@ const generationQueue = new Queue('generation', {
});
generationQueue.process(async (job) => {
const { jobId, type, topic, channelId, rubric, keywords, useCritique } = job.data;
const { jobId, type, topic, channelId, rubric, keywords, useCritique, customPrompt } = job.data;
await query(`UPDATE generation_jobs SET status='processing', updated_at=NOW() WHERE id=$1`, [jobId]);
@@ -28,12 +28,12 @@ generationQueue.process(async (job) => {
if (type === 'post') {
if (!channel) throw new Error('Channel not found for post generation');
const r = await ai.generatePost(channel, { topic, rubric, useCritique });
const r = await ai.generatePost(channel, { topic, rubric, useCritique, customPrompt });
resultText = r.content;
usage = r.usage;
} else if (type === 'article') {
const r = await ai.generateArticle(channel || { language: 'ru' }, { topic, keywords });
const r = await ai.generateArticle(channel || { language: 'ru' }, { topic, keywords, customPrompt });
resultText = r.content;
usage = r.usage;