ZennyKenny commited on
Commit
cec8822
·
verified ·
1 Parent(s): abc7f9f

add usage instructions

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -4,11 +4,21 @@ from sqlalchemy import text
4
  from smolagents import tool, CodeAgent, HfApiModel
5
  import spaces
6
  import pandas as pd
7
-
8
  from database import engine, receipts
9
-
10
  import pandas as pd
11
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  def get_receipts_table():
13
  """
14
  Fetches all data from the 'receipts' table and returns it as a Pandas DataFrame.
 
4
  from smolagents import tool, CodeAgent, HfApiModel
5
  import spaces
6
  import pandas as pd
 
7
  from database import engine, receipts
 
8
  import pandas as pd
9
 
10
+ gr.Markdown("""
11
+ ## Plain Text Query Interface
12
+
13
+ This tool allows you to query a receipts database using natural language. Simply type your question into the input box, and the tool will generate and execute an SQL query to retrieve relevant data. The results will be displayed in the output box.
14
+
15
+ ### How to Use:
16
+ 1. Enter a question related to the receipts data in the text box.
17
+ 2. The tool will convert your question into an SQL query and execute it.
18
+ 3. The result will be displayed in the output box.
19
+ 4. The current receipts table is also displayed for reference.
20
+ """)
21
+
22
  def get_receipts_table():
23
  """
24
  Fetches all data from the 'receipts' table and returns it as a Pandas DataFrame.