How to improve text to sql?

I am working on a POC for NLP to SQL query using the Langchain framework and OpenAI. Sometimes, the generated query has errors and giving wrong query. How can I improve the query generation process? Should I consider fine-tuning or any other method? Please provide some suggestions to improve the NLP to SQL conversion.

@ganeshkumar4145
What you are working on I just completed yesterday:
https://opensql.ai/ - Questions to SQL

I used OpenAI Assitant APIS and fine-tuning.

To provide more suggestions, I might review what you have done.