Q&A about short texts
Answering questions about a few paragraphs
It’s only a small change to support answering questions about short texts (e.g., individual paragraphs):
qa.py
You should see a response like this:
And a trace like this:
Exercises
Instead of answering directly, add “Let’s think step by step.” as a prefix to the answer part of the prompt. This is often referred to as chain-of-thought prompting.
After getting the answer, add another step that shows the question and answer to the agent and asks it to improve the answer.
Now iterate the improvement step until the answer stops changing or some # of steps is exceeded. Does this work? This is similar to diffusion models which take a noisy image and iteratively refine it until it’s clear and detailed.
Last updated