A Common-Sense Guide to AI Engineering: Overriding tool_calls in Agent Loop (page 179)

hi, Jay

The last statement in the if block in the for loop overrides the tool_calls created outside the while loop. Is that the intended purpose, as that would cut short iterating through the “original” tool_calls if/when the response includes additional function_calls? I thought appending would be more appropriate.