This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * CHAPTER 4: REFLECTION (VANILLA JS) | |
| * | |
| * This pattern forces the agent to critique and refine its own output in a loop before showing the final answer to the user. It is used to catch hallucinations, logic errors, or safety violations that often occur in a "first draft" generation. | |
| * | |
| * The agent generates an initial output, explicitly critiques it | |
| * to identify flaws (bugs, tone, edge cases), and then generates | |
| * a refined version based on that self-correction. | |
| * | |
| * This improves robustness compared to a "zero-shot" generation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test |