DenseFeed / baml_src /script.baml
j14i's picture
feat: ZeroGPU backend for Hugging Face Spaces deployment (#4)
864480d unverified
Raw
History Blame Contribute Delete
3.54 kB
function GenerateOutline(
date: string,
stories: StoryItem[]
) -> EpisodeOutline {
client MlxCreative
prompt #"""
You are an expert podcast executive producer. Your task is to design a cohesive, top-down narrative episode outline for DenseFeed, a daily tech-news podcast.
Here are the ranked stories for today:
{% for item in stories %}
- Story {{ item.rank }}: {{ item.title }} (Source: {{ item.source }})
Summary: {{ item.summary }}
{% endfor %}
Your outline MUST structure these stories into a compelling narrative arc:
1. Group the stories logically into 2-3 distinct thematic movements (e.g. group AI announcements together, or group infrastructure topics).
2. Define a clear narrative purpose for each movement (e.g. building tension about legacy code, scaling challenges, or developer fatigue).
3. Choose a key technical or narrative takeaway for each movement to keep the discussion focused.
4. Define a final "climax wisdom" — the overarching insight that connects the dots between all these developments (e.g. "AI is shifting from tools to autonomous financial agents, raising the stakes for developer auditing").
{{ ctx.output_format }}
"""#
}
function GenerateScriptSegment(
date: string,
story_title: string,
content_chunk: string,
previous_context: string?,
segment_type: string,
outline_context: string?
) -> ScriptLine[] {
client MlxCreative
prompt #"""
You write natural, engaging, long-form podcast scripts for DenseFeed (two hosts: Alex [Speaker A, curious/enthusiastic] and Jordan [Speaker B, analytical/skeptical]).
Match the style of Google NotebookLM: deep technical analysis, relatable analogies, back-and-forth banter, and follow-up questions.
{% if previous_context %}
Recent dialogue:
{{ previous_context }}
{% endif %}
{% if outline_context %}
Outline & transitions:
{{ outline_context }}
{% endif %}
We are discussing: "{{ story_title }}"
Content details:
{{ content_chunk }}
Segment format instructions:
{% if segment_type == "hook" %}
- Introduce the podcast and tease the core episode promise/theme.
- Start with a hook. No generic greetings ("welcome back").
- CRITICAL: Generate EXACTLY 4 to 6 dialogue turns.
{% elif segment_type == "deep_dive" %}
- Perform a thorough deep-dive. Build tension around a technical conflict/pain point first, then explain the solution.
- Use clear analogies. Jordan must push back with deep skepticism. Alex asks follow-up questions.
- CRITICAL: Generate EXACTLY 10 to 14 dialogue turns.
{% elif segment_type == "quick_hit" %}
- A brief but substantive check-in on this story. Explain the key insight and its practical impact.
- CRITICAL: Generate EXACTLY 4 to 6 dialogue turns.
{% elif segment_type == "outro" %}
- Deliver the final climax wisdom. Synthesize the big-picture future for senior developers.
- End with a warm, natural sign-off.
- CRITICAL: Generate EXACTLY 6 to 8 dialogue turns.
{% endif %}
RULES:
- Natural flow: alternating turns (A, B, A, B). Use banter, active listening, and simple analogies.
- Developer depth: focus on engineering tradeoffs and "Why does this matter for my stack?".
- Clean text: no prefix names (e.g. "Alex:"), no wrapping quotes, normal punctuation.
- NO REPETITION: Do not repeat previous context phrases, conversational structures, or vocabulary.
{{ ctx.output_format }}
"""#
}