We are trying to do step-by-step code generation in Python for our given problem statement. After every code step is generated, we execute the code separately (not through code execution feature) to verify it. However, we are seeing several instances of key errors in the generated code. Sharing one such instance below. Also, sharing the corresponding token usage. Our input token size is pretty large at 377K but its well within 1M limit. Has anybody faced this issue?
File “../lib/python3.11/site-packages/pandas/core/indexes/base.py”, line 3805, in get_loc
return self._engine.get_loc(casted_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “index.pyx”, line 167, in pandas._libs.index.IndexEngine.get_loc
File “index.pyx”, line 196, in pandas._libs.index.IndexEngine.get_loc
File “pandas/_libs/hashtable_class_helper.pxi”, line 7081, in pandas._libs.hashtable.PyObjectHashTable.get_item
File “pandas/_libs/hashtable_class_helper.pxi”, line 7089, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: ‘性別区分_ledger’
model_version=gemini-2.5-pro, input_tokens=377127, thoughts_tokens=1930, cached_tokens=None, output_tokens=20722, total_tokens=399779