← Back to Build an AI Agent in Python From Scratch

Module: Tools That Work

Practice Test: Tools That Work

Design tools a model uses correctly, get validated structured output, and guard risky actions.

9 questions. 15 minutes. You need at least 7 right to pass. This test is optional. It does not mark any lesson complete and it does not count towards your certificate.

Time left: 15:00

1. Why does run_tool return errors as JSON strings instead of raising exceptions?

2. In testing, how was the 'Lisboa' spelling finally handled?

3. Why does the generic exception branch report only the exception type?

4. What does JSON mode ({"type": "json_object"}) guarantee?

5. Why is the pydantic class used to generate the schema sent in response_format?

6. What does ask_structured send back to the model when validation fails?

7. What does ask_human do when no terminal is attached?

8. Why should approval show the real tool arguments?

9. Why is labelling tool output as untrusted_content not enough on its own?