Summary Table

In this example we ask a simple question that gives counts of data.

Video:

Coming soon…

User question: Give me a table of artist names from the data, sorted alphabetically.

VerbaGPT response:

Cost of query: $0.00

Answer:

A Cor Do Som
Aaron Copland & London Symphony Orchestra
Aaron Goldberg
AC/DC
Academy of St. Martin in the Fields & Sir Neville Marriner
Academy of St. Martin in the Fields Chamber Ensemble & Sir Neville Marriner
Academy of St. Martin in the Fields, John Birch, Sir Neville Marriner & Sylvia McNair
Academy of St. Martin in the Fields, Sir Neville Marriner & Thurston Dart
Academy of St. Martin in the Fields, Sir Neville Marriner & William Bennett
Accept
Adrian Leaper & Doreen de Feis
...and so on (all 275 artists shown in table)


VerbaGPT answered the question correctly. Since VerbaGPT comes with an embedding framework, it did not have to be told where to look, only pointed to a SQL server instance that contains many different databases including one that has the Chinook database. Chinook is a standard SQL database used for testing. Further, VerbaGPT provided a complete response, along with a helpful option to save the datable to a csv file.

VerbaGPT Message Window

The code below results in a complete answer, and user can edit and run it if they choose.

query = "SELECT Name FROM Artist ORDER BY Name ASC"
cursor.execute(query)
result = cursor.fetchall()
for row in result:
    print(row[0])

LangChain + OpenAI response:

Cost of query: $0.15

Langchain was able to execute almost the correct query, however it limited the answer to only the top 5 responses. This isn’t the complete answer to the user query.

The langchain agent did need an explicit and direct connection to the relevant database (i.e., Chinook) in order to try to answer this question.


Posted

in

, ,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *