Skip to course content
Free generative AI app course

Generative AI Application Development with Python

Module 08 Activity

Scenario

Users will upload files, and files are the least trustworthy input you will handle.

What you build

A file pipeline that rejects safely, chunks on sentences, extracts against a schema, and cites which part of the file an answer came from.

Steps

  1. Check encoding, emptiness and binary content before any file reaches a prompt. Construct one failing example of each.
  2. Chunk on sentence boundaries and measure how many chunks end at one.
  3. Extract structured records with a schema that includes bounds and patterns, not just types.
  4. List the qualifiers that must survive a summary and check for them mechanically.
  5. Cite the file and chunk in every answer, and run a term check against the cited text.
  6. Report the rejection rate by reason.

Evidence to hand in

Review checklist