@@ -188,7 +188,13 @@ def ask_chatgpt():
188
188
final = command
189
189
190
190
if final .startswith ("%sqlplot" ):
191
- _ , name , column = final .split (" " )
191
+ try :
192
+ _ , name , column = final .split (" " )
193
+ except Exception as e :
194
+ error_message = "Sorry, we couldn't run your query on the data. " \
195
+ "Please ensure you specify a relevant column."
196
+ set_messages (_messages + [Message (role = "assistant" , content = error_message , df = None , fig = None )])
197
+ return
192
198
193
199
fig = Figure ()
194
200
ax = fig .subplots ()
@@ -243,13 +249,13 @@ def Page():
243
249
solara .Text ("Data Querying and Visualisation App" )
244
250
245
251
with solara .Card (title = "About" , elevation = 6 , style = "background-color: #f5f5f5;" ):
246
- solara .Markdown ("""This Solara app is designed for chatting with your data. <br> <br>
247
- Examples of queries :
248
- unique column-name values ;
249
- select top 20 rows from table ; <br> <br>
250
- Example of queries that will return a plot :
251
- histogram on column ;
252
- boxplot on column""" )
252
+ solara .Markdown ("""
253
+ Interact with your data using natural language.
254
+
255
+ Examples: <br>
256
+ - show me the unique values of column {column name} <br>
257
+ - create a histogram of { column name} <br>
258
+ - create a boxplot of { column name} """ )
253
259
254
260
with solara .Sidebar ():
255
261
with solara .Card ("Controls" , margin = 0 , elevation = 0 ):
0 commit comments