Workflow Orchestration · Python SDK harness
Turn a Research PDF into a Two-Speaker Podcast
A Python notebook extracts text from a PDF, uses three sequential Kimi-K3 calls to produce research notes, an outline, and a structured host/guest script, then synthesizes dialogue lines and assembles a WAV podcast.
What This Workflow Does
Extracts text from a supplied PDF.
Creates source notes and a podcast outline in consecutive LLM calls.
Generates a JSON dialogue with host and guest turns.
Synthesizes each dialogue line with a selected voice, appends raw audio, and converts the result to WAV.
Agent, Harness & Requirements
The workflow runs on Together Cookbook serial-chain example inside a Python SDK harness. You embed the agent loop in Python and own the tools, state, and deployment.
- Python notebook environment.
- A Together API key supplied through TOGETHER_API_KEY.
- The notebook installs pydantic, together, pypdf, ffmpeg-python, and cartesia; it also lists ffmpeg and Linux audio development packages (libasound2-dev, portaudio19-dev, libportaudio2, libportaudiocpp0).
How It Works
- Provide a PDF; the example downloads arXiv paper 2406.04692 and names it MoA.pdf.
- Extract page text using pypdf's PdfReader.
- Call moonshotai/Kimi-K3 sequentially to extract useful details, draft an outline, and produce a structured host/guest dialogue.
- Send each dialogue line to the Together audio generations endpoint using cartesia/sonic, assigning a voice according to the speaker.
- Append the returned raw PCM audio and use FFmpeg to convert podcast.pcm into podcast.wav.
Notebook API and model settings (excerpt)
TOGETHER_API_KEY = os.getenv("TOGETHER_API_KEY", "--Your API Key--")
client = Together(api_key=TOGETHER_API_KEY)
# LLM stages use model='moonshotai/Kimi-K3'
# Audio request settings shown in the notebook:
{"model": "cartesia/sonic", "response_format": "raw", "response_encoding": "pcm_f32le", "sample_rate": 44100, "stream": False}Evidence & Source
Documented Documented: the notebook provides Python code for PDF text extraction with pypdf, three sequential LLM calls (extract details, create an outline, generate a structured host/guest dialogue), and line-by-line speech generation followed by PCM-to-WAV conversion with FFmpeg. Its worked input is an arXiv PDF about Mixture-of-Agents. This is a cookbook implementation example, not an independent reproduction or performance evaluation.
Serial Chain Agent Workflow — PDF-to-Podcast notebook
Open the sourceLimitations
- The notebook's PDF extraction code sets a text-length limit and provides conflicting guidance about the recommended maximum length; it demonstrates one workflow and does not report independent quality or performance measurements.
This record describes what the source states. It is not a review, a benchmark, or a recommendation. If the tool has changed since the check date, report it.