The codebase deliberately chose CodeAgent (code-as-actions) over the more common JSON tool-call format as its primary agent paradigm. The README cites two papers to justify this: code actions require 30% fewer steps than JSON tool dictionaries, and outperform JSON agents on difficult benchmarks. The benchmark code lives in examples/smolagents_benchmark/run.py.
A consequence of this choice is that the entire execution pipeline must maintain a consistent code format across: the system prompt (which explains the format to the LLM), the parser (parse_code_blobs() in src/smolagents/utils.py), and the executor (LocalPythonExecutor or a remote executor). A fix-up pass (fix_final_answer_code() in src/smolagents/local_python_executor.py) handles the common LLM mistake of assigning to final_answer instead of calling it as a function.
README.mdsrc/smolagents/local_python_executor.pysrc/smolagents/utils.py