Preview Your Chunks

Print the chunk count and inspect the first chunk

💻

Writing code and entering commands is only available on desktop. Open this page on a larger screen to complete this chapter.

Inspecting your output

Before moving to embeddings, verify that chunking works. A quick preview function prints two things:

  • The total number of chunks
  • The text of the first chunk

This is a debugging habit worth keeping throughout the pipeline.

Instructions

Complete the preview_chunks function. The starter code provides the signature.

  1. Print f"Total chunks: {len(chunks)}".
  2. Print f"First chunk:\n{chunks[0]}".