This is an easy one.
- OpenAI Text to SQL
- Prompt Example - Natural Language to SQL
- https://platform.openai.com/examples/default-sql-translate
Start with the above. That’s the basics. Define your schema. But as has been stressed again and again above, you’ve got to do it in a way that clearly explains to the LLM how to respond to the questions it will get.
- OpenAI Functions calling the Poor Developers Vector Database
- Private Chat with CSV Data (@DevGirl explanation):
- My Prompt Example:
Look at the example from above:
Here is a case where, above and beyond the schema, you ALSO explain to the LLM:
- Queries with respect to users and sales orders will use the sale_order table
- The user id in the sales_order table is the partner_id field