mou3az commited on
Commit
cf47baa
·
verified ·
1 Parent(s): 188d0d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -3
app.py CHANGED
@@ -1,4 +1,3 @@
1
-
2
  import csv
3
  import json
4
  import os
@@ -1281,6 +1280,29 @@ def Chart_Generator(
1281
  f"<br>{analysis_text}"
1282
  )
1283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1284
  except Exception as e:
1285
 
1286
  combined_content = (
@@ -2517,5 +2539,4 @@ demo.launch(
2517
  max_file_size="5mb",
2518
  max_threads=50,
2519
  theme=gr.themes.Soft()
2520
- )
2521
-
 
 
1
  import csv
2
  import json
3
  import os
 
1280
  f"<br>{analysis_text}"
1281
  )
1282
 
1283
+ messages3.append(
1284
+ HumanMessage(
1285
+ content=(
1286
+ "The user requested this chart:\n"
1287
+ f"{chart_description}"
1288
+ )
1289
+ )
1290
+ )
1291
+
1292
+ messages3.append(
1293
+ AIMessage(
1294
+ content=(
1295
+ "A chart was generated with "
1296
+ "the following Chart.js configuration:\n\n"
1297
+ f"{json.dumps(chart_config, indent=2)}\n\n"
1298
+ "Chart URL:\n"
1299
+ f"{chart_url}"
1300
+ )
1301
+ )
1302
+ )
1303
+
1304
+ messages3 = messages3[-6:]
1305
+
1306
  except Exception as e:
1307
 
1308
  combined_content = (
 
2539
  max_file_size="5mb",
2540
  max_threads=50,
2541
  theme=gr.themes.Soft()
2542
+ )