Write a script to process and chunk large documents for a RAG pipeline.
Implement chunk_documents(documents, max_words, overlap_words), which accepts a list of documents containing id and text, then returns ordered chunk dictionaries containing id, chunk_index, and whitespace-normalized text. Each chunk may contain at most max_words words, consecutive chunks from the same document must share overlap_words words, and empty documents produce no chunks.
id and a string textdef chunk_documents(documents, max_words, overlap_words):