Skip to content

Example: Blog Article Generator

Work in Progress

This example is under active development and may change.

This example generates complete SEO-optimized blog articles from a structured request. It uses a two-step pipeline: create an outline, then write the full article.

Get the code

GitHub

What it demonstrates

  • Structured input concept (BlogArticleRequest with topic, audience, tone, length)
  • Two-step content generation: outline then write
  • Constrained choices for tone and length fields

The Method: bundle.mthds

Input concept

[concept.BlogArticleRequest]
description = "Structured request describing the blog article to generate"

[concept.BlogArticleRequest.structure]
text = { type = "text", description = "Free-form instruction for the article", required = true }
topic = { type = "text", description = "The main topic of the blog article", required = true }
audience = { type = "text", description = "Target audience for the article", required = true }
tone = { type = "text", description = "Writing tone", choices = [
  "Casual", "Professional", "Humorous", "Academic",
], required = true }
length = { type = "text", description = "Desired article length", choices = [
  "Short", "Medium", "Long",
], required = true }

Pipeline

[pipe.generate_blog_article]
type = "PipeSequence"
inputs = { user_prompt = "BlogArticleRequest" }
output = "BlogArticle"
steps = [
  { pipe = "create_outline", result = "outline" },
  { pipe = "write_article", result = "article" },
]

How to run

pipelex run bundle examples/wip/blog_article_generator/bundle.mthds \
  -i examples/wip/blog_article_generator/inputs.json