You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1d7b367
Browse filesBrowse the repository at this point in the historyBrowse files
autoblog: hero image only, at medium quality (~$10/day -> ~$0.60/day) (#347)
The daily autoblog run (15 articles across 10 sites at 09:00 UTC) drew a hero
plus 3 inline gpt-image-2 images per article at HIGH quality: 60 images at
~$0.165, about $9.90 a day on the shared OpenAI key. Anthony picked option B:
one hero image per article, at medium (~$0.04).
- IMAGE_QUALITY high -> medium (hero, any inline, and the repair sweep).
- INLINE_IMAGE_COUNT 3 -> 0. The system prompt now asks for no placeholders;
with the count above 0 the old instructions come back unchanged.
- The schema no longer fails an article whose model returns inline slots
anyway: normalizeArticleOutput trims them to INLINE_IMAGE_COUNT, and
dropUnfilledInlineMarkers strips any stray <!--INLINE_IMAGE_N--> from the
body (articles and guest posts).
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
// The receiver quality gate counts every rendered <a>. A 30-link table
170
182
// of contents can push link density over 1% even when the body only has
@@ -297,21 +309,28 @@ export function buildSystemPrompt(): string {
297
309
"",
298
310
"Internal links: insert each provided URL inline exactly once as a standard markdown `[anchor](url)` link where the surrounding sentence is genuinely about that URL's topic. Never create a \"Further reading\" list. Never invent URLs — use only those provided. Link candidates may include both site pages AND prior blog posts on this same site — treat both the same way (inline contextual anchor; the prior posts are clearly labeled in the candidate list).",
299
311
"",
300
-
`Inline images: place exactly ${INLINE_IMAGE_COUNT} placeholder lines of the form '<!--INLINE_IMAGE_1-->', '<!--INLINE_IMAGE_2-->', '<!--INLINE_IMAGE_3-->' (each on its own line, in numeric order) inside markdown_body. Place each marker on a blank line immediately after a major H2 boundary, distributed across the body — never inside the intro, the TOC, a blockquote, a table, or inside the final '### Try {brand}' CTA block.`,
301
-
"",
302
-
`For each placeholder, return one object in inline_image_prompts (same 1→${INLINE_IMAGE_COUNT} order). Each object MUST set a kind that fits what the surrounding section is doing — this is the difference between a decorative blob and an informative graphic:`,
303
-
"",
304
-
"- kind=\"chart\" — when the section discusses metrics, percentages, comparisons of magnitudes, or trends. Provide 2–5 short labels (≤24 chars each) that should appear on bars/segments. Plausible numbers are fine; the chart is illustrative.",
305
-
"- kind=\"flow\" — when the section walks through a process or workflow with 3–5 steps. Provide the step labels in order.",
306
-
"- kind=\"comparison\" — when the section explicitly contrasts two approaches (good/bad, before/after, wrong/right). Provide exactly 2 labels (e.g., [\"Before\", \"After\"]).",
307
-
"- kind=\"checklist\" — when the section is a 'do these things' list of 3–6 items. Provide the checklist labels.",
308
-
"- kind=\"concept\" — fallback for atmospheric / opening sections where no data, flow, comparison, or list is being presented. No labels needed.",
309
-
"",
310
-
"Aim for a MIX across the three inline images — at least one should be chart/flow/comparison/checklist when the article has any quantitative or procedural content. 'concept' is fine for at most one of the three.",
311
-
"",
312
-
"alt: a short accessibility description of what the image shows.",
313
-
"prompt: a one-sentence brief describing the image's content (this becomes the image-model prompt). Don't include style direction — the renderer adds it.",
314
-
"",
312
+
...(INLINE_IMAGE_COUNT>0
313
+
? [
314
+
`Inline images: place exactly ${INLINE_IMAGE_COUNT} placeholder lines of the form '<!--INLINE_IMAGE_1-->', '<!--INLINE_IMAGE_2-->', '<!--INLINE_IMAGE_3-->' (each on its own line, in numeric order) inside markdown_body. Place each marker on a blank line immediately after a major H2 boundary, distributed across the body — never inside the intro, the TOC, a blockquote, a table, or inside the final '### Try {brand}' CTA block.`,
315
+
"",
316
+
`For each placeholder, return one object in inline_image_prompts (same 1→${INLINE_IMAGE_COUNT} order). Each object MUST set a kind that fits what the surrounding section is doing — this is the difference between a decorative blob and an informative graphic:`,
317
+
"",
318
+
"- kind=\"chart\" — when the section discusses metrics, percentages, comparisons of magnitudes, or trends. Provide 2–5 short labels (≤24 chars each) that should appear on bars/segments. Plausible numbers are fine; the chart is illustrative.",
319
+
"- kind=\"flow\" — when the section walks through a process or workflow with 3–5 steps. Provide the step labels in order.",
320
+
"- kind=\"comparison\" — when the section explicitly contrasts two approaches (good/bad, before/after, wrong/right). Provide exactly 2 labels (e.g., [\"Before\", \"After\"]).",
321
+
"- kind=\"checklist\" — when the section is a 'do these things' list of 3–6 items. Provide the checklist labels.",
322
+
"- kind=\"concept\" — fallback for atmospheric / opening sections where no data, flow, comparison, or list is being presented. No labels needed.",
323
+
"",
324
+
"Aim for a MIX across the three inline images — at least one should be chart/flow/comparison/checklist when the article has any quantitative or procedural content. 'concept' is fine for at most one of the three.",
325
+
"",
326
+
"alt: a short accessibility description of what the image shows.",
327
+
"prompt: a one-sentence brief describing the image's content (this becomes the image-model prompt). Don't include style direction — the renderer adds it.",
328
+
"",
329
+
]
330
+
: [
331
+
"Inline images: none. Put no image placeholders, HTML comments or image markdown in markdown_body, and return inline_image_prompts as an empty array.",
332
+
"",
333
+
]),
315
334
"Output: strict JSON matching the schema. The markdown_body is the article body only.",
316
335
].join("\n");
317
336
}
@@ -1480,6 +1499,8 @@ export async function generateArticle(
0 commit comments