Add scheduled automatic content drafts with Codex and image automation
This commit is contained in:
@@ -76,7 +76,7 @@ export async function processNextPostJob(baseUrl: string) {
|
||||
const logoPalette = await logoPalettePrompt(page.pictureUrl);
|
||||
const content = await generateStructured({
|
||||
kind: "post-generation", pageId: job.pageId, userId: job.requestedById,
|
||||
system: SYSTEM, effort: "medium", schema: Draft, waitForWorker: true,
|
||||
system: SYSTEM + (job.requestKey.startsWith("auto:") ? "\nThis is an automatic content slot. Choose a fresh, relevant topic from the shop profile and brief data. Avoid repeating the supplied recent topics. Never invent prices, promotions, availability or claims. The slot is creation time, not a publication promise." : ""), effort: "medium", schema: Draft, waitForWorker: true,
|
||||
prompt: `${profilePrompt(profile)}\n${logoPalette}\n\n${platformRule(job.targets.includes("INSTAGRAM"))}\n\n<topic>\n${job.topic}\n</topic>`,
|
||||
});
|
||||
if (job.targets.includes("INSTAGRAM") && content.caption.length > 2200) throw new UserFacingError("Caption ที่ AI สร้างยาวเกินข้อจำกัด Instagram กรุณาลองใหม่");
|
||||
|
||||
Reference in New Issue
Block a user