Open AI Assistants API vs Playground Assistants

Hi everyone,
We are a small team, trying to build a chatbot, we use assistants api, with gpt-4o model, The assistants api generates a SQL that hits our BigQuery systems and gets us the json results, which it further analyses and push it to the UI. We are facing few issues in this implementation flow -

  1. The SQL generated by Assistants API is not consistent everytime.
    What are the techniques that I can implement to make the results constant.

  2. The responses are not consistent too everytime, we lose the confidence if a complex prompt would work everytime.

  3. The results if we we execute in the playground (https://platform.openai.com/playground/assistants) are a lot better when we compare the results from assistants api, wondering what would the playground uses to generate nicer SQL statements and analyse them perfectly.

If anyone has explored other approaches (I heard we can do with CSV too) but not sure how does that implementation go).