Open API cannot sum total of group of expenditures

The calculation provided seems to be correct. Let’s break it down step by step:

  1. Expenditure for the 10 entries:

    • Entry 1: $2822.83
    • Entry 2: $1224.56
    • Entry 3: $2725.53
    • Entry 4: $1305.02
    • Entry 5: $837.56
    • Entry 6: $2419.63
    • Entry 7: $2241.06
    • Entry 8: $2736.23
    • Entry 9: $1720.66
    • Entry 10: $1984.59
  2. Total expenditure:
    $2822.83 + $1224.56 + $2725.53 + $1305.02 + $837.56 + $2419.63 + $2241.06 + $2736.23 + $1720.66 + $1984.59 = $19,072.71

So, the total expenditure is indeed $19,072.71, matching the calculated value provided in the response. Therefore, it seems that the calculation is correct.

The above is recieved from ChatGPT as well as from a python script using OpenAPI key. Difficult to understand why it is failing for basic junior grade arithmetic.

Welcome @ronojoymca.

Could you please confirm that you used ChatGPT 3.5?

If so, it’s not surprising that ChatGPT incorrectly calculated the sum. LLMs aren’t good at doing math.

If you were to use ChatGPT 4, you would almost certainly obtain the correct calculation because ChatGPT would write Python code to perform the calculation.

Regarding your Python script, you will receive similar results to that of using ChatGPT 3.5. If you were to use the Assistants API with the Code Interpreter tool, you would enable the model to write Python code and therefore perform the correct calculation.

I hope this helps clarify things for you!

Note: You’re referencing “OpenAPI” when you actually mean “OpenAI”.

1 Like