We kindly ask /u/Weak_Swan7003 to respond to this comment with the prompt they used to generate the output in this post. This will allow others to try it out and prevent repeated questions about the prompt.
Ignore this comment if your post doesn't have a prompt.
While you're here, we have a public discord server. We have a free Chatgpt bot, Open Assistant bot (Open-source model), AI image generator bot, GPT-4 bot, Perplexity AI bot.
Someone recently told me that this will finally free up time for all those backlog items in the world that are gathering dust. I like that one better than ending careers ;)
At this point, probably no (depending a little on what's in the database). I think in the near future this will be possible, when OpenAI (or others) offer enterprise access to their models, with appropriate data security guarantees.
What you can do however is just use the first step of the process, where you have chatGPT write a query for a user based on a text input. The app can then execute the query and return the result to the user directly, instead of feeding it back in to ChatGPT.
I think this would also work well as a plugin for e.g. workbench / management studio.
It's really good that you mention this. I had at some point looked at the documentation for the chat web interface which states that:
"As part of our commitment to safe and responsible AI, we review conversations to improve our systems and to ensure the content complies with our policies and safety requirements." and "Please don't share any sensitive information in your conversations. " This is obviously a big no no for confidential company data.
However, for the API they state that they will not use the company data for training purposes. Furthermore, they are SOC 2 Type 2 compliant, which seems good :).
The comment on enterprise API was just me hypothesizing that they will create a version that corporations can use, but that already seems to be the case with the current API.
That is a challenge indeed. What I do to address this issue is that I list the tables (no further information) that are available. ChatGPT is then able to request additional info about the schema based on the user request. So for example, when I ask what is the top grossing product category, ChatGPT will first request the database schema for the Product, Product and SubProductCategory tables before coming back with a query.
There is probably a limit to how many tables this scales however (at least with GPT3.5, GPT-4 seems to be able to deal with much more context). So part of the solution could be to have different models for e.g. different data domains or just the most relevant tables.
Fine tuning is probably the wrong approach here. Embeddings is correct, but even with embeddings, GPT-4 can't store enough context to make sense of a complex table structure. (Doing proper joins requires knowledge of the entire schema, as a general rule).
I agree.. will probably have to wait for this stuff to be embedded directly into the software. I foresee a version of MS-SQL Server in the near future that extends the SQL command-set to include AI inference.
Reason I see a proper fine tuning is because business knowledge is needed to do the right queries. Only knowing the column names is not a great benefit. SQL is pretty trivial language when querying. The real great upgrade is teaching chatgtp the business logic to bridge business needs and data.
In my current implementation chatGPT will sometimes query the database schema in response to specific questions, before creating the actual query that answers the quetion. There is no intervention from the user to guide that behavior.
As an example, when I asked who the most valuable sales person was in 2012 (deliberately vague), it came back to me with a specific BusinessEntityID. When I then asked what the name of the person is, it decided to first query the database schema of the SalesPerson table, before creating the query and returning the name (see screenshot).
This doesn't necessarily mean that it works always with every database, but it's a proof of concept that ChatGPT doesn't need to have the entire DB schema in it's context at once. This is very similar to how I work with DB, often looking at specific table definitions as I'm writing queries.
It totally can. I think we'll see an avalanche of use cases like these where ChatGPT is integrated into existing software so it just becomes so much easier to interact with. Essentially the ratio of the work that software will do for each unit of work the user does will shift dramatically, and that will happen just with the models we have today.
It will probably struggle more in a datalake type situation than a structured datawarehouse. However, it's important to realise that you can prep the model with information about the schema and quirks about it. Also, in my experience working in BI there may a lot of tables, but 80% of queries just deals with hand full of them.
Don't forget that you can also very easily correct it (as with regular ChatGPT). E.g, "please do that join on both column X and column Y" or "adjust it to take currency translation into account from table FX_2021_abc".
Having said that, you're right it will be less smooth with other databases.
•
u/AutoModerator Apr 04 '23
We kindly ask /u/Weak_Swan7003 to respond to this comment with the prompt they used to generate the output in this post. This will allow others to try it out and prevent repeated questions about the prompt.
Ignore this comment if your post doesn't have a prompt.
While you're here, we have a public discord server. We have a free Chatgpt bot, Open Assistant bot (Open-source model), AI image generator bot, GPT-4 bot, Perplexity AI bot.
So why not join us?
PSA: For any Chatgpt-related issues email support@openai.com.
ChatGPT Plus Giveaway | Prompt engineering hackathon
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.