# 'NoneType' object is not subscriptable with FinalAnswerTool

smolagents FinalAnswerTool crashing with "'NoneType' object is not subscriptable" (also seen as 'Error in generating tool call with model'): it is a bug in how the agent handles a model response with no tool calls (message.tool_calls is None), not your prompt or tool setup. Fixed by PR #614. Upgrade smolagents past the release containing #614; if it is not released yet, install from main: pip install -e PATH_TO_SMOLAGENTS_ROOT_DIRECTORY.

## Context from the issue
gh:huggingface/smolagents#404: Issue huggingface/smolagents#404 (closed, 9 comments): I am trying to reproduce the agentic RAG cookbook example. But I noticed that the FinalAnswerTool was almost always throwing me an error. I tried with gpt4o (AzureOpenAI) and mistral-large-2407 (OpenAI-compatible API). I also replaced ToolCallingAgent by CodeAgent, the error log is different but it still does not work most of the time. Error: "Error in generating tool call with model: 'NoneType' object is not subscriptable"