Basic Plot

In this example we ask VerbaGPT to produce a simple plot.

Video:

Coming soon…

User question: Give me a histogram for Rings.

VerbaGPT response:

Cost of query: $0.00

Answer:

VerbaGPT answered the question correctly. Since VerbaGPT comes with an embedding framework, it did not have to be told which database (i.e., Db_Test_01*) to look into, or which table within the database is relevant to the user query. In this case, there is a table called “d_Abalone” in the Db_Test_01 database, that has a column called Rings. This column is a proxy for the age of Aabalones (a type of mollusc), and other columns (like shell weight, height, etc.) are characteristics of Abalones that may help us determine age.

Lastly, VerbaGPT provided a complete response, along with a helpful option to save the plot to an image file on disk (which the user can later use for presentations, reports, etc.)

VerbaGPT Message Window

In addition to producing the chart, VerbaGPT also provides the user with the following (editable) code. If the user chooses to, they can edit the code before hitting execute button, or simply hit execute without editing the code to produce the image shown above.

import matplotlib.pyplot as plt
import pandas as pd

query = "SELECT Rings FROM d_Abalone"
df = pd.read_sql(query, conn)

plt.hist(df['Rings'], bins=10)
plt.xlabel('Rings')
plt.ylabel('Frequency')
plt.title('Histogram of Rings')
plt.show()

LangChain + OpenAI response:

Cost of query: $0.15

The langchain agent’s reponse is incorrect. The user meant a histogram using the values in the “Rings” column, not a simple count of values in that column.

The langchain agent did need an explicit and direct connection to the relevant database (i.e., Db_Test_01) on our testing system in order to attempt an answer to this question

*Db_Test_01 is a testing database on our system.


Posted

in

,

by

Comments

One response to “Basic Plot”

  1. Mark Wright Avatar

    This is exactly what democratizaton of data should look like. I love the editable code feature, as it makes the experience dynamic, as a climate scientist, this is very important to me.

Leave a Reply

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