HighTechPipefitter
HighTechPipefitter t1_j6xjlgw wrote
Reply to comment by dgrsmith in GPT tool that lets you connect to databases and ask questions in text. by Mogen1000
Fun starts here: https://platform.openai.com/examples/default-sql-translate
Then "all you need" is to create an API call with python to get the query from OpenAI and send that query to your database through another API call.
Start small, there's a lot of little quirks but the potential is definitely there.
I expect that in the coming years you will start to see a bunch of articles about the best practice on how to integrate an AI with a database.
Good luck.
HighTechPipefitter t1_j6xe1ge wrote
Reply to comment by dgrsmith in GPT tool that lets you connect to databases and ask questions in text. by Mogen1000
There's definitely a learning curve for the user to learn to properly express themselves. But there's also different strategies you can use to help them.
A library of common prompt examples is a first one.
A UI with predefined chunks of query that you assemble is another.
You could also use embeddings to detect ambiguity and ask your user for precision.
You also don't need to expose your whole schema right away, this can be done gradually. You start with the most common requests and build from there. This way you don't need to invest a huge amount of resources from the beginning.
We are barely scratching the surface on how to use it. This will be common practice pretty soon.
If you are in a position that you have access to a database at work, I strongly suggest that you give it a try. It's surprisingly good.
HighTechPipefitter t1_j6x0ki5 wrote
Reply to comment by dgrsmith in GPT tool that lets you connect to databases and ask questions in text. by Mogen1000
>This was discussed over on
>
>r/datascience
>
>too. We’d love it if it worked out of the box, but the knowledge requirements needed to tell the tool what tables do and what each of their columns mean requires a level of documentation that most companies don’t have reliably
If your tables and columns are named explicitely you can get away with just feeding it your database schema and the AI will figure out what you are talking about.
If not, you can create views to make it more clear what each table and column means and feed it that instead.
You can also give it special rules to keep in mind. For example, if in your DB a "man" is identified as "1" and a woman as "2", you can add this instruction to your prompt and the AI will understand that whenever you are looking for a man it needs to check for the value "1".
I expect text-to-SQL will become a standard pretty soon. It's just way too strong.
HighTechPipefitter t1_j6wxp2z wrote
Reply to comment by Southern_Orange3744 in GPT tool that lets you connect to databases and ask questions in text. by Mogen1000
You can look at an example here: https://platform.openai.com/examples/default-sql-translate
HighTechPipefitter t1_j6wmqrt wrote
Reply to comment by Southern_Orange3744 in GPT tool that lets you connect to databases and ask questions in text. by Mogen1000
It's not that bad, the AI only knows the structure of your data and not the data itself.
HighTechPipefitter t1_j6xlimi wrote
Reply to ChatGPT Passes US Medical Licensing Exams Without Cramming by RareGur3157
> raising questions about whether the AI chatbot could one day help write the exam or help students prepare for it.
It's raising a much more important question than that...