Loading topic
search_docs tool and the run_agent loop from the earlier chapters. It covers one decision in the loop: whether the model searches at all on a given turn.5 min readsearch_docs tool looks like. You should also understand the agent loop that runs tool calls until the model gives a final answer. Here we focus on the argument the model 5 min read{"id": ..., "text": ...} and that you can call a model from Python.4 min readcall_model receives the whole messages list on every step, and that tool results are appended to that list. It also assumes you can read basic Python.4 min readsearch_docs tool that returns {"id", "text"} passages, and the step budget. You also need basic Python and regular expressions.6 min readrun_agent loop works and how search_docs is exposed as a tool. You should also be comfortable reading short Python functions. No security background is needed.5 min readMAX_STEPS cap and tool results appended to messages. It also assumes you know how a classic retrieve-then-generate pipeline works. The question here is practical: what does letting the model drive retrieval c6 min readsearch_docs 5 min read