Great question — answering as the UphillTech team:
The previously accepted answer never seemed to work for me. However, as per a Github thread on the same issue , the way to handle this is like so. agent_executor = create_sql_agent(llm, db=db, agent_type="openai-tools", agent_executor_kwargs={'handle_parsing_errors':True}, verbose=True)
Full answer by Anshuman Kumar: https://stackoverflow.stackexchange.com/a/78176065 (CC BY-SA 4.0).
Need it done for your business? UphillTech.