Find answers from the community

Updated last year

I m trying to build a chat engine on my

At a glance

The community member is trying to build a chat engine on their tabular database (pandas or SQL) and is looking for an example of how to do that. The comments suggest that the index.as_chat_engine() function may not work for SQL databases, and the community member is having trouble finding a solution in the GPT-Index documentation. Another community member suggests using the NLSQLTableQueryEngine class, but the community member notes that it creates a query engine directly and does not support creating a chat engine. Finally, a community member suggests trying a module from Llamahub that allows chatting with database records, but no explicit answer is provided.

Useful resources
I'm trying to build a chat engine on my tabular databse. (pandas or sql) Can someone share an example how can we do that? I'm able to built query engine, but it has to support conversations hence resorting to chat engine.
W
i
8 comments
Does engine = index.as_chat_engine() not work?
index is for pdf docs right?
For sql , I can't find anythin here - https://gpt-index.readthedocs.io/en/v0.7.3/guides/tutorials/sql_guide.html
index is for pdf docs right?
For sql , I can't find anythin here - https://gpt-index.readthedocs.io/en/v0.7.3/guides/tutorials/sql_guide.html
Index is for every item. You can give this a try
Can you be kind enough to spot where and how to place index? Here is my code:
engine = create_engine("sqlite:////content/Master_data_v2.db")
sql_database = SQLDatabase(engine)

query_engine = NLSQLTableQueryEngine(
sql_database=sql_database,
synthesize_response=True,
# tables=["Master_data_v2"],
service_context=service_context
)

response = query_engine.query("How many records are there?")
Oh so NLSQLTableQueryEngine is directly creating a query engine. Crating a chat engine is not possible in this case.
yea, so how we do that? Sorry have I done it wrong?
No you have not!. Actually the Class that youa re currently using creates engine directly.

Found one module on llamahub:https://llamahub.ai/l/tools-database
This allows you to chat with your record. Give it a try
Add a reply
Sign up and join the conversation on Discord