Text-to-SQL or Text-to-Dataframe

Ok so, I’m making a Text-to-SQL or Text-to-Dataframe application, I used RAG+prompting and all that stuff at first for this at first but the answers were mostly wrong numbers. So then I moved towards Agentic RAG approach.
I have two questions:

  1. What are best approaches to create this application which accurate in terms of NL to SQL and in terms of accurately getting the numbers right from Data.
  2. I am trying Function Calling method from OpenAI, It is working well right because there are only few functions. Question is, do I have to create functions for every possible scenario or there is more generic approach towards this?