Matthias Mohr commited on
Commit
850e622
·
1 Parent(s): 3761383

Improve prompt

Browse files
Files changed (1) hide show
  1. fiboa/app.py +10 -8
fiboa/app.py CHANGED
@@ -42,16 +42,17 @@ If you are asked to "map" or "show on a map", then be select the "geometry" colu
42
  If asked to show a "table", you must not include the "geometry" column from the query results.
43
 
44
  Use the following format: return only the SQLQuery to run. DO NOT use the prefix with "SQLQuery:".
45
- Do not include an explanation.
46
 
47
  Pay close attention to use only the column names that you can see in the schema description. Be careful to
48
  not query for columns that do not exist. Also, pay attention to which column is in which table.
49
 
50
- Tables include {table_info}. The data you should use always comes from the table called "crops".
51
- Only use that table, do not use the "testing" table. Pay close attention to this table schema.
52
 
53
- The column area is in the unit hectares, you may need to convert it to other units, e.g. square meters.
54
- The column perimeter is in the unit meters, you may need to convert it to other units, e.g. kilometers.
 
55
 
56
  Question: {input}
57
  '''
@@ -64,7 +65,8 @@ db = SQLDatabase.from_uri("duckdb:///duck.db", view_support=True)
64
  chain = create_sql_query_chain(llm, db, prompt=new_prompt, k=100)
65
 
66
  '''
67
- Ask me about fiboa data! Request "a map" to get map output, or table for tabular output, e.g.
 
68
 
69
  - Show a map with the 10 largest fields
70
  - Show a table of the total area by crop type
@@ -82,7 +84,7 @@ with st.container():
82
  st.divider()
83
 
84
  '''
85
- Data sources: https://source.coop/fiboa
86
- Data License: CC-BY-SA-4.0
87
  Software License: BSD
88
  '''
 
42
  If asked to show a "table", you must not include the "geometry" column from the query results.
43
 
44
  Use the following format: return only the SQLQuery to run. DO NOT use the prefix with "SQLQuery:".
45
+ Do not include an explanation. Do only use SQL functions that DuckDB supports.
46
 
47
  Pay close attention to use only the column names that you can see in the schema description. Be careful to
48
  not query for columns that do not exist. Also, pay attention to which column is in which table.
49
 
50
+ Tables include {table_info}. The data comes comes always from the table called "crops".
51
+ Do never use the "testing" table. Pay close attention to this table schema.
52
 
53
+ The column "area" is in the unit hectares, you may need to convert it to other units, e.g. square meters.
54
+ The column "perimeter" is in the unit meters, you may need to convert it to other units, e.g. kilometers.
55
+ The column "collection" contains the country codes for the Baltic states: "ec_lt" for Latvia, "ec_lv" for Lithuania, "ec_ee" for Estonia.
56
 
57
  Question: {input}
58
  '''
 
65
  chain = create_sql_query_chain(llm, db, prompt=new_prompt, k=100)
66
 
67
  '''
68
+ Ask me about fiboa data (here: all baltic states)!
69
+ Request "a map" to get map output, or table for tabular output, e.g.
70
 
71
  - Show a map with the 10 largest fields
72
  - Show a table of the total area by crop type
 
84
  st.divider()
85
 
86
  '''
87
+ Data sources: https://source.coop/fiboa |
88
+ Data License: CC-BY-SA-4.0 |
89
  Software License: BSD
90
  '''