Question about Ungraded Lab - Improving SQL Generation

I have a question about section 3.1. Use an LLM to Query a Database:

It looks like the notebook already know that the SQL query is wrong, even knew exactly the output (-190571.46).

I thought the LLM output (the SQL query in this case) is non-deterministic and we can not predict the generated SQL hence the query output?

Hi newgnart,

Note that in the call to gpt-4.1 in the function generate_sql the temperature parameter is set to 0. This makes the call highly determinative. This could still leave minor room for variation, but the SQL code required is very straightforward and the data is simple and constant.

That makes sense. Thanks for the answer!