1. I got an error with the code line `if "tool_calls" in agent_res["message"].keys():` 1. Error: `'Message' object has no attribute 'keys'` 2. Diagnosis: I checked the type. It shows: `type(agent_res["message"])` as `ollama._types.Message` 1. I checked its attributes using `agent_res["message"].__dir__()` and noticed that it includes `dict` 3. Fix: I added `dict()` so the modified code looks as: `if "tool_calls" in agent_res["message"].dict().keys():` 1. That started working fine.