feat: custom prompt for articles + HD image quality per channel

- ai.js: generateArticle принимает customPrompt (от юзера) или channel.ai_style_prompt
- articles.js + routes/articles.js: проброс customPrompt через цепочку
- postImages.js: channel.image_quality='hd' → gpt-5.4-image-2+medium, иначе gpt-5-image-mini+low
- aiUsage.js: правильные цены routerai (RUB/token), gpt-5-image-mini и gpt-5.4-image-2
- channels.js: updateChannel сохраняет ai_style_prompt и image_quality
- DB: channels.ai_style_prompt TEXT, channels.image_quality VARCHAR(16) DEFAULT standard
This commit is contained in:
Ник (Claude)
2026-06-11 15:11:18 +03:00
parent e6c192e806
commit 1ef770b5fc
6 changed files with 42 additions and 11 deletions
+2 -2
View File
@@ -72,7 +72,7 @@ async function getAllTags() {
* Генерирует и сохраняет статью.
* @param {object} opts - { topic, keywords, tags, autoPublish }
*/
async function generateAndSaveArticle({ topic, keywords = [], tags = [], autoPublish = true, category = 'ai-tools' }) {
async function generateAndSaveArticle({ topic, keywords = [], tags = [], autoPublish = true, category = 'ai-tools', customPrompt }) {
// job
const { rows: jobRows } = await query(
`INSERT INTO generation_jobs (type, topic, status) VALUES ('article',$1,'processing') RETURNING id`,
@@ -118,7 +118,7 @@ async function generateAndSaveArticle({ topic, keywords = [], tags = [], autoPub
},
};
const articleRes = await ai.generateArticle(blogChannel, { topic, keywords });
const articleRes = await ai.generateArticle(blogChannel, { topic, keywords, customPrompt });
const content = articleRes.content;
// вытаскиваю title (первый H1 или первая строка) и excerpt