For AI agents: a documentation index is available at /llms.txt. Markdown versions of all documentation pages are available by appending .md to the URL path.
Outcome: A roundup.json file with 5 top headlines on a topic, each
paired with a generated editorial illustration. Render it however you want
(static page, daily email, RSS feed).
Approx cost: ~$0.21 per roundup.
#!/bin/bash
set -euo pipefail
TOPIC="${1:-developments in space exploration}"
# 1. Pull recent headlines via a search-capable LLM
visa-cli run-llm --json --yes \
--model or-perplexity-sonar \
"Top 5 recent headlines about $TOPIC. Return strict JSON array: [{\"title\":\"...\",\"summary\":\"...\"}]" \
| jq -r '.text' \
| jq -c '.[]' > stories.ndjson
# 2. For each story, generate an editorial illustration
rm -f roundup.ndjson
while IFS= read -r story; do
TITLE=$(echo "$story" | jq -r .title)
IMG=$(visa-cli generate image \
"editorial illustration for: $TITLE" \
--json --yes \
| jq -r '.urls[0] // .filePath')
echo "$story" | jq --arg img "$IMG" '. + {image: $img}' >> roundup.ndjson
done < stories.ndjson
# 3. Bundle into a single JSON array
jq -s '.' < roundup.ndjson > roundup.json
rm stories.ndjson roundup.ndjson
echo "Roundup ready: $(jq '. | length' roundup.json) stories in roundup.json"
| Step | Tool | Approx |
|---|---|---|
| Headlines | or-perplexity-sonar |
$0.01 |
| Illustrations (5 × $0.04) | fal-flux-pro |
$0.20 |
| Total | ~$0.21 |
run-llm first to draft a tailored image prompt before sending to
generate image.roundup.json into a tiny templating step.