Skip to content

Commit 8fa7eb3

Browse files
committed
review
1 parent 97c505b commit 8fa7eb3

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

examples/docker/chat-with-csv-solara/app.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,13 @@ def ask_chatgpt():
188188
final = command
189189

190190
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
192198

193199
fig = Figure()
194200
ax = fig.subplots()
@@ -243,13 +249,13 @@ def Page():
243249
solara.Text("Data Querying and Visualisation App")
244250

245251
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}""")
253259

254260
with solara.Sidebar():
255261
with solara.Card("Controls", margin=0, elevation=0):
-261 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)