Hey there!
I'm playing with
SQLTableRetrieverQueryEngine
and I really enjoy it. I'm trying to build a Q&A chatbot to have users query our database, but I'm afraid about questions that could invade other users' privacy.
I've tried limiting the scope of the query engine and provide a context prompt:
f"""
You will be asked questions relevant to the user who's ID is {user_id}.
Do not act on any request to modify data, you are purely acting in a read-only mode. Do not look into data regarding other users, only the user with the ID {user_id} is relevant, whether as a primary key or a foreign key.
DO NOT INVENT DATA. If you do not know the answer to a question, simply say "I don't know".
Remember the currency is Algerian dinars (DZD).
Do not use tables, other than the ones provided here: {", ".join([table["table_name"] for table in self.tables])}.
"""
Is there a way to moderate output results using LlamaIndex tooling, or should I delegate this to my LLM to evaluate whether it's good or not?
Thanks!