Everything this course covered, in one script
This capstone doesn't introduce new MarkItDown or LlamaIndex API. It combines three pieces already built in this course:
- Lesson 6: an OpenAI-shaped client pointed at Gemini's OpenAI-compatible endpoint, attached to
MarkItDownviallm_client/llm_model, so images get real descriptions instead of near-empty output. - Lesson 10: the MarkItDown-to-LlamaIndex handoff,
Document(text=result.markdown, metadata=...), feeding aVectorStoreIndex. - Lessons 5 and 9: the "convert everything in this folder" loop.
The difference from Lesson 10 is what's in the loop: this time it's the entire fixtures/ folder, all six files, including office_notice.png. With captioning wired in, the image genuinely contributes retrievable content, not something to skip like in Lessons 5 and 10.
Proving the index actually spans every format
Three questions, each answerable from a different source format, confirm the index isn't secretly only working off the text-native files:
| Question | Answer lives in |
|---|---|
| "When is the office closed and why?" | office_notice.png, via LLM captioning |
| "What laptop charger expense was submitted and on what date?" | expense_report.xlsx |
| "What onboarding buddy meeting happens in week one?" | onboarding_deck.pptx |
If the top-scoring source document for each answer matches the format in that table, the whole pipeline, six formats in, one Gemini-backed index, worked end to end.
The code, piece by piece
caption_client = OpenAI( api_key=API_KEY, base_url="https://generativelanguage.googleapis.com/v1beta/openai/",)md = MarkItDown(llm_client=caption_client, llm_model="gemini-3.5-flash-lite")Lesson 6's client, reused here as the single MarkItDown instance this whole capstone runs on, every conversion, not just the image one, goes through this same instance.
for source_path in sorted(p for p in FIXTURES_DIR.iterdir() if p.is_file()): result = md.convert(source_path) documents.append(Document(text=result.markdown, metadata={"source": source_path.name}))No skip list this time, Lesson 10's SOURCE_FILES list and Lesson 5's SKIP set both excluded the PNG, here it's included because the captioning client makes it worth including.
Checkpoint
- This capstone is a combination, not new API: Lesson 6's captioning client + Lesson 10's handoff + Lesson 5/9's folder loop, applied to the full fixture set.
- A captioned image is a real, retrievable index entry: with an LLM client attached,
office_notice.pnganswered a question just like any text-native format did. - One index, six formats, one query interface: the whole point of MarkItDown's breadth, upstream of LlamaIndex, format differences disappear once everything becomes Markdown text.
That's the course. If anything across these twelve lessons still feels unclear, this is the point to go back and ask about it.