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
+1 -1
View File
@@ -116,7 +116,7 @@ async function updateChannel(channelId, userId, data) {
if (Object.keys(channelFields).length) {
const fields = ['name', 'tg_channel_id', 'tg_username', 'bot_token',
'niche', 'audience', 'goal', 'language', 'region', 'is_active',
'vk_access_token'];
'vk_access_token', 'ai_style_prompt', 'image_quality'];
const updates = fields.filter(f => channelFields[f] !== undefined);
if (updates.length) {
const setClauses = updates.map((f, i) => `${f}=$${i + 1}`).join(', ');