R
Good catch, thank you! You're right: I shortened the loop for the article, and that version always calls get_disk_free() and re-appends the assistant message for every call. The code in the repo does it your way: a TOOLS dict mapping each name to its function, response.message appended once, then TOOLS[call.function.name](**call.function.arguments) for each call. It doesn't validate arguments yet, so I'll add that and fix the snippet in the article. The full version is tools.py in the GitHub repo linked at the top of the post.