← Table of Contents · Page 213 of 868
CONTEXT CONSTRUCTION (THE CONTEXT BUILDER)
Part 9 of 12
PRACTICE LAB CONNECTION
Build the Resume Review Agent lab's context builder module in Chapters 65 and 66, and test the prompts below against it.
Start by writing the builder as a plain function called buildContext, which takes the standing rules, the current task, the history, and the selected documents, and returns one assembled string.
Add a function that counts tokens and refuses to exceed the budget.
Add a reminder function that appends the no-fabrication rule at the end every few turns.
Then print the assembled prompt for one run and read it yourself, line by line, as if you were the model.
If anything looks confusing to you, it will likely confuse the model too.
Advertisement
Read Aloud:
0:00 / 0:00