File size: 165,893 Bytes
fb856e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Welcome to the Second Lab - Week 1, Day 3\n",
    "\n",
    "Today we will work with lots of models! This is a way to get comfortable with APIs."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table style=\"margin: 0; text-align: left; width:100%\">\n",
    "    <tr>\n",
    "        <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",
    "            <img src=\"../assets/stop.png\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
    "        </td>\n",
    "        <td>\n",
    "            <h2 style=\"color:#ff7800;\">Important point - please read</h2>\n",
    "            <span style=\"color:#ff7800;\">The way I collaborate with you may be different to other courses you've taken. I prefer not to type code while you watch. Rather, I execute Jupyter Labs, like this, and give you an intuition for what's going on. My suggestion is that you carefully execute this yourself, <b>after</b> watching the lecture. Add print statements to understand what's going on, and then come up with your own variations.<br/><br/>If you have time, I'd love it if you submit a PR for changes in the community_contributions folder - instructions in the resources. Also, if you have a Github account, use this to showcase your variations. Not only is this essential practice, but it demonstrates your skills to others, including perhaps future clients or employers...\n",
    "            </span>\n",
    "        </td>\n",
    "    </tr>\n",
    "</table>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Start with imports - ask ChatGPT to explain any package that you don't know\n",
    "\n",
    "import os\n",
    "import json\n",
    "from dotenv import load_dotenv\n",
    "from openai import OpenAI\n",
    "from anthropic import Anthropic\n",
    "from IPython.display import Markdown, display"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Always remember to do this!\n",
    "load_dotenv(override=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "OpenAI API Key exists and begins sk-proj-\n",
      "Anthropic API Key exists and begins sk-ant-\n",
      "Google API Key exists and begins AI\n",
      "DeepSeek API Key exists and begins sk-\n",
      "Groq API Key exists and begins gsk_\n"
     ]
    }
   ],
   "source": [
    "# Print the key prefixes to help with any debugging\n",
    "\n",
    "openai_api_key = os.getenv('OPENAI_API_KEY')\n",
    "anthropic_api_key = os.getenv('ANTHROPIC_API_KEY')\n",
    "google_api_key = os.getenv('GOOGLE_API_KEY')\n",
    "deepseek_api_key = os.getenv('DEEPSEEK_API_KEY')\n",
    "groq_api_key = os.getenv('GROQ_API_KEY')\n",
    "\n",
    "if openai_api_key:\n",
    "    print(f\"OpenAI API Key exists and begins {openai_api_key[:8]}\")\n",
    "else:\n",
    "    print(\"OpenAI API Key not set\")\n",
    "    \n",
    "if anthropic_api_key:\n",
    "    print(f\"Anthropic API Key exists and begins {anthropic_api_key[:7]}\")\n",
    "else:\n",
    "    print(\"Anthropic API Key not set (and this is optional)\")\n",
    "\n",
    "if google_api_key:\n",
    "    print(f\"Google API Key exists and begins {google_api_key[:2]}\")\n",
    "else:\n",
    "    print(\"Google API Key not set (and this is optional)\")\n",
    "\n",
    "if deepseek_api_key:\n",
    "    print(f\"DeepSeek API Key exists and begins {deepseek_api_key[:3]}\")\n",
    "else:\n",
    "    print(\"DeepSeek API Key not set (and this is optional)\")\n",
    "\n",
    "if groq_api_key:\n",
    "    print(f\"Groq API Key exists and begins {groq_api_key[:4]}\")\n",
    "else:\n",
    "    print(\"Groq API Key not set (and this is optional)\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "request = \"Please come up with a challenging, nuanced question that I can ask a number of LLMs to evaluate their intelligence. \"\n",
    "request += \"Answer only with the question, no explanation.\"\n",
    "messages = [{\"role\": \"user\", \"content\": request}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'role': 'user',\n",
       "  'content': 'Please come up with a challenging, nuanced question that I can ask a number of LLMs to evaluate their intelligence. Answer only with the question, no explanation.'}]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "messages"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "How would you approach designing a sustainable urban environment that balances economic growth, social equity, and environmental conservation, while also considering the impact of climate change and technological advancements?\n"
     ]
    }
   ],
   "source": [
    "openai = OpenAI()\n",
    "response = openai.chat.completions.create(\n",
    "    model=\"gpt-4o-mini\",\n",
    "    messages=messages,\n",
    ")\n",
    "question = response.choices[0].message.content\n",
    "print(question)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "competitors = []\n",
    "answers = []\n",
    "messages = [{\"role\": \"user\", \"content\": question}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "Designing a sustainable urban environment that balances economic growth, social equity, and environmental conservation requires a multifaceted approach. Here are key strategies to consider:\n",
       "\n",
       "### 1. **Integrated Planning Framework**:\n",
       "   - **Holistic Vision**: Develop a comprehensive plan that incorporates long-term goals across economic, social, and environmental dimensions. Utilize systems thinking to understand interdependencies.\n",
       "   - **Stakeholder Engagement**: Involve a diverse group of stakeholders, including citizens, businesses, government agencies, and NGOs, in the planning process to ensure that multiple perspectives are considered.\n",
       "\n",
       "### 2. **Economic Growth**:\n",
       "   - **Sustainable Businesses**: Encourage the establishment of businesses that prioritize sustainability, such as green technologies and local food systems, providing incentives for startups and innovations in renewable energy.\n",
       "   - **Green Jobs**: Invest in job training programs that focus on green technology and sustainable practices to create pathways for employment that contribute to the economy while benefiting the environment.\n",
       "   - **Circular Economy**: Promote a circular economy that minimizes waste and encourages the reuse and recycling of materials.\n",
       "\n",
       "### 3. **Social Equity**:\n",
       "   - **Affordable Housing**: Implement policies that ensure access to affordable, high-quality housing for all residents, prioritizing mixed-income developments.\n",
       "   - **Inclusive Transportation**: Develop public transportation systems that are accessible and affordable, with a focus on reducing reliance on personal vehicles to enhance mobility for all demographic groups.\n",
       "   - **Community Facilities**: Invest in public spaces, parks, and community centers that foster social interaction, well-being, and provide services for all residents, paying particular attention to underrepresented communities.\n",
       "\n",
       "### 4. **Environmental Conservation**:\n",
       "   - **Green Infrastructure**: Incorporate green roofs, urban forests, and permeable surfaces to manage stormwater, reduce urban heat islands, and promote biodiversity.\n",
       "   - **Renewable Energy**: Transition to renewable energy sources, such as solar and wind, and encourage decentralized energy systems that allow communities to manage their energy needs.\n",
       "   - **Sustainable Land Use**: Utilize zoning laws that promote compact, mixed-use developments to limit urban sprawl and protect surrounding natural areas.\n",
       "\n",
       "### 5. **Climate Change Mitigation and Adaptation**:\n",
       "   - **Resilient Infrastructure**: Design infrastructure with resilience in mind, using materials and techniques that withstand climate impacts, such as flooding and extreme temperatures.\n",
       "   - **Climate Action Plans**: Develop and enforce local climate action plans that set emissions reduction targets, promote renewable energy use, and enhance disaster preparedness strategies.\n",
       "   - **Ecosystem Services**: Protect and restore local ecosystems to provide natural solutions to climate change impacts, such as wetlands for flood control and urban trees for air quality improvement.\n",
       "\n",
       "### 6. **Leveraging Technological Advancements**:\n",
       "   - **Smart Cities**: Integrate smart technologies to enhance urban service delivery, efficiency, and sustainability (e.g., smart grids, efficient waste management systems).\n",
       "   - **Data-Driven Decision Making**: Utilize data analytics to monitor environmental impacts, social needs, and economic performance, allowing for agile responses to challenges.\n",
       "   - **Public Engagement Platforms**: Create digital platforms that allow residents to engage in urban planning and communicate their needs and ideas effectively.\n",
       "\n",
       "### 7. **Education and Awareness**:\n",
       "   - **Community Education Programs**: Establish programs that educate citizens about sustainability, resilience, and the importance of social equity in creating a cohesive urban environment.\n",
       "   - **Collaborations with Educational Institutions**: Partner with schools and universities to conduct research, projects, and internships focused on sustainability and urban challenges.\n",
       "\n",
       "### Conclusion\n",
       "The success of a sustainable urban environment hinges on continuous evaluation and adaptation of strategies in response to emerging challenges and opportunities. By fostering collaboration among stakeholders and leveraging technological advancements, cities can build resilient urban landscapes that thrive economically while ensuring social equity and environmental health. Implementing these strategies holistically will create vibrant communities that are prepared for the future."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# The API we know well\n",
    "\n",
    "model_name = \"gpt-4o-mini\"\n",
    "\n",
    "response = openai.chat.completions.create(model=model_name, messages=messages)\n",
    "answer = response.choices[0].message.content\n",
    "\n",
    "display(Markdown(answer))\n",
    "competitors.append(model_name)\n",
    "answers.append(answer)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "# Designing a Sustainable Urban Environment\n",
       "\n",
       "My approach would integrate multiple dimensions of sustainability through these key strategies:\n",
       "\n",
       "## Foundational Planning Principles\n",
       "- Implement **mixed-use zoning** to reduce commute distances and create vibrant neighborhoods\n",
       "- Adopt **circular economy models** where waste becomes a resource\n",
       "- Design for **climate resilience** with infrastructure that anticipates extreme weather events\n",
       "- Use **systems thinking** to understand how transportation, housing, energy, and social systems interact\n",
       "\n",
       "## Environmental Strategies\n",
       "- Develop **green infrastructure networks** (urban forests, bioswales, green roofs)\n",
       "- Transition to **renewable energy** with district systems and microgrids\n",
       "- Prioritize **water-sensitive urban design** for conservation and flood management\n",
       "- Create **biodiversity corridors** connecting urban green spaces\n",
       "\n",
       "## Social Equity Considerations\n",
       "- Ensure **affordable housing** across all neighborhoods through inclusionary zoning\n",
       "- Design **accessible public spaces** that accommodate diverse needs and ages\n",
       "- Implement **participatory planning processes** centering marginalized communities\n",
       "- Distribute **environmental amenities equitably** to prevent \"green gentrification\"\n",
       "\n",
       "## Economic Framework\n",
       "- Support **local businesses and circular economies** through procurement policies\n",
       "- Invest in **green jobs training** for marginalized communities\n",
       "- Create **innovation districts** for sustainable technology development\n",
       "- Use **progressive taxation** to fund public infrastructure and services\n",
       "\n",
       "## Technology Integration\n",
       "- Deploy **smart city infrastructure** that respects privacy and reduces consumption\n",
       "- Implement **digital inclusion programs** to ensure equitable technology access\n",
       "- Use **data analytics** to optimize resource use and service delivery\n",
       "\n",
       "Success would ultimately depend on collaborative governance involving diverse stakeholders and continuous adaptation as conditions evolve."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Anthropic has a slightly different API, and Max Tokens is required\n",
    "\n",
    "model_name = \"claude-3-7-sonnet-latest\"\n",
    "\n",
    "claude = Anthropic()\n",
    "response = claude.messages.create(model=model_name, messages=messages, max_tokens=1000)\n",
    "answer = response.content[0].text\n",
    "\n",
    "display(Markdown(answer))\n",
    "competitors.append(model_name)\n",
    "answers.append(answer)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "Designing a sustainable urban environment that truly balances economic growth, social equity, and environmental conservation, while also factoring in climate change and technological advancements, requires a holistic, integrated, and adaptive approach. It's not a static blueprint but a dynamic framework for continuous evolution.\n",
       "\n",
       "Here's a comprehensive approach:\n",
       "\n",
       "---\n",
       "\n",
       "## **A Holistic Approach to Sustainable Urban Design**\n",
       "\n",
       "The core principle is **systems thinking**, recognizing that all elements of the city are interconnected. Changes in one area will inevitably impact others.\n",
       "\n",
       "### **Phase 1: Visioning, Assessment & Stakeholder Engagement**\n",
       "\n",
       "1.  **Comprehensive Baseline Assessment:**\n",
       "    *   **Environmental:** Current emissions, air/water quality, biodiversity, resource consumption (energy, water, waste), vulnerability to climate hazards (flooding, heatwaves, sea-level rise).\n",
       "    *   **Economic:** Key industries, employment rates, income distribution, existing infrastructure, innovation capacity.\n",
       "    *   **Social:** Demographics, housing affordability, access to services (education, healthcare, transport), green spaces, public safety, social cohesion, digital literacy.\n",
       "    *   **Technological:** Existing infrastructure, digital divide, local innovation ecosystem.\n",
       "\n",
       "2.  **Inclusive Stakeholder Engagement:**\n",
       "    *   **Government:** All levels (municipal, regional, national).\n",
       "    *   **Private Sector:** Businesses, industries, developers, tech companies.\n",
       "    *   **Academia & Research:** Universities, think tanks for data, innovation, and expertise.\n",
       "    *   **Civil Society:** NGOs, community groups, residents (especially marginalized communities), youth.\n",
       "    *   **Purpose:** Co-create a shared vision, identify priorities, gather diverse perspectives, build consensus, and foster ownership. This is crucial for ensuring social equity is embedded from the start.\n",
       "\n",
       "3.  **Define Goals & Key Performance Indicators (KPIs):**\n",
       "    *   Establish measurable, time-bound targets for all three pillars (e.g., X% reduction in emissions by 20XX, X% affordable housing, Y% green space per capita, Z% local job creation).\n",
       "    *   Include climate resilience metrics (e.g., reduced flood risk, increased permeable surfaces).\n",
       "\n",
       "### **Phase 2: Integrated Design & Planning Principles**\n",
       "\n",
       "This phase translates the vision into actionable plans, emphasizing cross-sectoral integration.\n",
       "\n",
       "1.  **Eco-Centric Infrastructure & Urban Planning:**\n",
       "    *   **Energy:** Transition to 100% renewable energy sources (solar, wind, geothermal). Implement smart grids, demand-side management, energy efficiency standards for buildings, and district heating/cooling. Promote decentralized energy generation.\n",
       "    *   **Water:** Implement integrated water management (IWM) – closed-loop systems, rainwater harvesting, greywater recycling, wastewater treatment for reuse, permeable surfaces to reduce runoff and replenish groundwater. Protect natural water bodies.\n",
       "    *   **Waste:** Move towards a circular economy model. Drastically reduce waste generation, maximize reuse and recycling, promote composting, and explore waste-to-energy where appropriate (as a last resort after reduction/reuse).\n",
       "    *   **Green & Blue Infrastructure:** Prioritize green spaces (parks, urban forests, vertical gardens) and blue spaces (rivers, canals, ponds) for biodiversity, air purification, urban cooling (combating heat islands), stormwater management, and public well-being. Create ecological corridors.\n",
       "    *   **Sustainable Mobility:** Design for transit-oriented development (TOD). Prioritize walking, cycling, and robust, efficient, and accessible public transport (electric buses/trams, high-speed rail connections). Discourage private car use through infrastructure and policy (e.g., congestion pricing). Promote shared mobility services (bikes, EVs).\n",
       "    *   **Sustainable Buildings:** Mandate high standards for energy efficiency, passive design, use of local and recycled materials, green roofs/walls, and water conservation in all new and renovated buildings.\n",
       "\n",
       "2.  **Economic Growth through Sustainability:**\n",
       "    *   **Green Economy Development:** Foster industries related to renewable energy, sustainable manufacturing, ecological restoration, green technology, and circular economy solutions. This creates new jobs and economic diversification.\n",
       "    *   **Local & Resilient Supply Chains:** Support local businesses, urban agriculture, and short supply chains to reduce transport emissions, build community wealth, and enhance resilience to external shocks.\n",
       "    *   **Innovation Hubs:** Create dedicated zones for R&D in green tech, smart city solutions, and sustainable materials, fostering collaboration between academia, startups, and established companies.\n",
       "    *   **Resource Efficiency as Economic Driver:** Demonstrate how reducing energy, water, and waste consumption leads to significant cost savings for businesses and residents, making the city more competitive and attractive for investment.\n",
       "\n",
       "3.  **Social Equity at the Core:**\n",
       "    *   **Affordable & Inclusive Housing:** Implement policies for mixed-income developments, inclusionary zoning, and social housing initiatives to prevent gentrification and ensure housing access for all income levels. Design diverse housing types.\n",
       "    *   **Equitable Access to Services:** Ensure all residents have easy access to quality education, healthcare, public transport, green spaces, cultural facilities, and healthy food options, regardless of income or neighborhood.\n",
       "    *   **Participatory Governance:** Establish ongoing mechanisms for citizen engagement in planning, decision-making, and oversight. Empower local communities.\n",
       "    *   **Digital Inclusion:** Bridge the digital divide by ensuring universal access to affordable high-speed internet and digital literacy programs, enabling participation in the smart city and access to services.\n",
       "    *   **Health & Wellbeing:** Design for walkable neighborhoods, safe public spaces, clean air, and access to nature to promote physical and mental health. Address noise pollution.\n",
       "\n",
       "4.  **Climate Change Mitigation & Adaptation:**\n",
       "    *   **Mitigation:** Directly addressed by the environmental conservation strategies (renewable energy, sustainable transport, waste reduction). Set ambitious carbon neutrality targets.\n",
       "    *   **Adaptation & Resilience:**\n",
       "        *   **Infrastructure:** Design climate-resilient infrastructure (e.g., elevated roads in flood zones, heat-resistant materials, decentralized energy for grid resilience).\n",
       "        *   **Nature-Based Solutions:** Utilize green and blue infrastructure for flood protection, heat island mitigation (e.g., street trees, permeable pavements), and shoreline protection.\n",
       "        *   **Early Warning Systems:** Implement advanced sensor networks and data analytics for real-time monitoring of weather patterns, air quality, and potential hazards, providing timely alerts to residents.\n",
       "        *   **Emergency Preparedness:** Develop robust disaster response plans and community-level resilience programs.\n",
       "        *   **Water Security:** Plan for drought resilience through diversified water sources and efficient use.\n",
       "\n",
       "5.  **Leveraging Technological Advancements:**\n",
       "    *   **Smart City Technologies:** Utilize IoT sensors, AI, and big data analytics for:\n",
       "        *   **Resource Management:** Optimize energy use (smart grids), water distribution, and waste collection.\n",
       "        *   **Traffic Management:** Reduce congestion and emissions.\n",
       "        *   **Environmental Monitoring:** Real-time air/water quality, noise levels, heat maps.\n",
       "        *   **Public Safety:** Enhanced security and emergency response.\n",
       "    *   **Digital Platforms for Citizen Engagement:** Develop accessible online platforms for participatory planning, feedback, and service delivery.\n",
       "    *   **Advanced Materials:** Research and implement sustainable, durable, and low-carbon building materials (e.g., self-healing concrete, bio-based materials).\n",
       "    *   **Autonomous Vehicles/Drones:** Explore their potential for optimized public transport, last-mile delivery, and infrastructure inspection (while managing potential social/environmental impacts).\n",
       "    *   **Digital Twin Technology:** Create virtual models of the city to simulate different scenarios (e.g., flood impacts, traffic flow, energy consumption) and test design interventions before implementation.\n",
       "\n",
       "### **Phase 3: Governance, Policies & Implementation**\n",
       "\n",
       "1.  **Integrated Governance Model:** Establish a cross-departmental task force or agency responsible for overseeing sustainable urban development, breaking down traditional silos.\n",
       "2.  **Policy & Regulatory Framework:**\n",
       "    *   Incentivize sustainable practices (tax breaks for green buildings, subsidies for renewables).\n",
       "    *   Mandate environmental performance standards.\n",
       "    *   Implement carbon pricing or emissions trading schemes.\n",
       "    *   Streamline permitting for sustainable projects.\n",
       "    *   Robust zoning laws that encourage mixed-use development and protect green spaces.\n",
       "3.  **Financing & Investment:**\n",
       "    *   Attract green finance, impact investors, and public-private partnerships.\n",
       "    *   Explore municipal green bonds.\n",
       "    *   Leverage national and international climate funds.\n",
       "4.  **Pilot Projects & Scalability:** Start with small, manageable pilot projects to test concepts, gather data, and demonstrate success before scaling up.\n",
       "5.  **Education & Capacity Building:** Invest in training for urban planners, engineers, policymakers, and the public on sustainable practices and climate change.\n",
       "\n",
       "### **Phase 4: Monitoring, Evaluation & Adaptive Management**\n",
       "\n",
       "1.  **Continuous Monitoring:** Regularly track progress against established KPIs using data from sensors, citizen feedback, and traditional surveys.\n",
       "2.  **Regular Review & Evaluation:** Conduct periodic reviews to assess the effectiveness of policies and interventions.\n",
       "3.  **Adaptive Management:** Be prepared to adjust strategies and plans based on monitoring data, emerging technologies, unforeseen challenges, and evolving community needs. This is critical for long-term resilience and flexibility in the face of rapid change.\n",
       "4.  **Transparency & Reporting:** Publish regular reports on the city's sustainability performance, fostering accountability and public trust.\n",
       "\n",
       "---\n",
       "\n",
       "**Challenges & Balancing Act:**\n",
       "\n",
       "The biggest challenge is often the **trade-offs**. For example:\n",
       "*   Economic growth often historically came at an environmental cost. The design must demonstrate how green economy can *drive* growth.\n",
       "*   New infrastructure might displace communities; social equity demands robust resettlement plans and community benefit agreements.\n",
       "*   Technological advancements raise privacy concerns; robust data governance and ethical AI principles are crucial.\n",
       "\n",
       "The \"balancing act\" is achieved not by compromising on each pillar, but by finding **synergies** where they reinforce each other. A healthy environment supports a productive economy and human well-being. A vibrant economy can fund sustainable infrastructure and social programs. Social equity ensures that the benefits of sustainability are shared by all, fostering a more resilient and cohesive community capable of adapting to future challenges."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "gemini = OpenAI(api_key=google_api_key, base_url=\"https://generativelanguage.googleapis.com/v1beta/openai/\")\n",
    "model_name = \"gemini-2.5-flash\"\n",
    "\n",
    "response = gemini.chat.completions.create(model=model_name, messages=messages)\n",
    "answer = response.choices[0].message.content\n",
    "\n",
    "display(Markdown(answer))\n",
    "competitors.append(model_name)\n",
    "answers.append(answer)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "Designing a sustainable urban environment that balances economic growth, social equity, and environmental conservation—while addressing climate change and leveraging technology—requires a holistic, systems-thinking approach. Here’s a step-by-step framework:\n",
       "\n",
       "### **1. Vision and Stakeholder Engagement**  \n",
       "- **Define Shared Goals**: Establish a clear vision integrating sustainability, equity, and resilience (e.g., carbon neutrality by 2050, zero displacement, green job creation).  \n",
       "- **Participatory Planning**: Engage communities, businesses, NGOs, and policymakers to ensure diverse needs are met (e.g., co-design workshops, digital platforms for feedback).  \n",
       "\n",
       "### **2. Compact, Mixed-Use Urban Design**  \n",
       "- **Transit-Oriented Development (TOD)**: Prioritize dense, walkable neighborhoods with mixed-income housing near public transit to reduce car dependency.  \n",
       "- **15-Minute City Concept**: Ensure access to jobs, schools, healthcare, and recreation within short distances.  \n",
       "- **Green Infrastructure**: Integrate parks, urban forests, and green roofs to mitigate heat islands and manage stormwater.  \n",
       "\n",
       "### **3. Climate-Resilient Infrastructure**  \n",
       "- **Adaptive Buildings**: Mandate net-zero energy designs, passive cooling, and flood-resistant materials.  \n",
       "- **Renewable Energy Microgrids**: Decentralize energy with solar/wind + battery storage to enhance resilience.  \n",
       "- **Blue-Green Systems**: Use permeable pavements, bioswales, and restored wetlands to combat flooding.  \n",
       "\n",
       "### **4. Equitable Economic Growth**  \n",
       "- **Green Jobs & Training**: Invest in renewable energy, circular economy (recycling, upcycling), and local agriculture.  \n",
       "- **Inclusive Zoning**: Reserve affordable housing units and protect against gentrification (e.g., community land trusts).  \n",
       "- **Support for Informal Sectors**: Integrate street vendors and gig workers into formal urban plans.  \n",
       "\n",
       "### **5. Smart & Low-Carbon Mobility**  \n",
       "- **Prioritize Public Transit**: Electric buses, bike lanes, and pedestrian-friendly streets.  \n",
       "- **Shared Mobility**: Promote carpooling, e-scooters, and autonomous shuttles to reduce private car ownership.  \n",
       "- **Freight Electrification**: Transition delivery fleets to EVs and optimize logistics with AI.  \n",
       "\n",
       "### **6. Circular Economy & Resource Efficiency**  \n",
       "- **Zero-Waste Systems**: Incentivize composting, recycling, and industrial symbiosis (waste = resource).  \n",
       "- **Water Reuse**: Implement greywater recycling and rainwater harvesting.  \n",
       "- **Sustainable Materials**: Use low-carbon concrete, recycled steel, and modular construction.  \n",
       "\n",
       "### **7. Technology for Sustainability & Equity**  \n",
       "- **Digital Twins**: Model urban systems (energy, traffic) to optimize planning.  \n",
       "- **IoT Sensors**: Monitor air quality, water use, and energy consumption in real time.  \n",
       "- **AI for Equity**: Use data to identify underserved areas (e.g., food deserts, transit gaps).  \n",
       "\n",
       "### **8. Governance & Policy Innovation**  \n",
       "- **Carbon Pricing & Green Bonds**: Fund sustainability projects via taxes on emissions/pollution.  \n",
       "- **Inclusive Policies**: Mandate social impact assessments for new developments.  \n",
       "- **Regional Collaboration**: Coordinate with neighboring cities on shared resources (water, energy grids).  \n",
       "\n",
       "### **9. Monitoring & Adaptive Management**  \n",
       "- **KPIs for Success**: Track metrics like GHG reductions, air quality, job creation, and affordability.  \n",
       "- **Iterative Feedback**: Use citizen science and digital dashboards to refine strategies.  \n",
       "\n",
       "### **Example: Copenhagen’s 2025 Carbon Neutral Plan**  \n",
       "- **Biking Infrastructure**: 50% commute by bike.  \n",
       "- **District Heating**: 98% from renewables.  \n",
       "- **Climate Adaptation**: Parks double as flood basins.  \n",
       "\n",
       "### **Key Trade-offs to Manage**  \n",
       "- **Density vs. Green Space**: High density reduces sprawl but requires careful green integration.  \n",
       "- **Tech vs. Privacy**: Smart cities must protect data rights.  \n",
       "- **Growth vs. Equity**: Ensure economic expansion doesn’t displace vulnerable groups.  \n",
       "\n",
       "By integrating these strategies, cities can become **prosperous, fair, and regenerative**—future-proofing against climate risks while improving quality of life. Would you like a deeper dive into any specific aspect?"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "deepseek = OpenAI(api_key=deepseek_api_key, base_url=\"https://api.deepseek.com/v1\")\n",
    "model_name = \"deepseek-chat\"\n",
    "\n",
    "response = deepseek.chat.completions.create(model=model_name, messages=messages)\n",
    "answer = response.choices[0].message.content\n",
    "\n",
    "display(Markdown(answer))\n",
    "competitors.append(model_name)\n",
    "answers.append(answer)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "Designing a sustainable urban environment requires a holistic approach that balances economic growth, social equity, and environmental conservation while considering the impact of climate change and technological advancements. Here's a comprehensive approach to achieve this balance:\n",
       "\n",
       "**I. Climate-Resilient Urban Planning**\n",
       "\n",
       "1. **Green Infrastructure**: Incorporate green spaces, parks, and green roofs to mitigate urban heat islands, manage stormwater runoff, and improve air quality.\n",
       "2. **Climate-Resilient Design**: Design buildings and infrastructure to withstand extreme weather events, such as sea-level rise, flooding, and droughts.\n",
       "3. **Adaptive Urban Planning**: Develop flexible and adaptable urban plans that can respond to changing climate conditions and emerging technologies.\n",
       "\n",
       "**II. Sustainable Transportation Systems**\n",
       "\n",
       "1. **Electrification of Transportation**: Promote the adoption of electric vehicles, public transportation, and non-motorized transportation options, such as walking and cycling.\n",
       "2. **Smart Traffic Management**: Implement intelligent transportation systems that optimize traffic flow, reduce congestion, and minimize emissions.\n",
       "3. **Multimodal Transportation**: Encourage the use of multiple transportation modes, including public transportation, walking, and cycling, to reduce reliance on personal vehicles.\n",
       "\n",
       "**III. Energy-Efficient and Renewable Energy Systems**\n",
       "\n",
       "1. **Renewable Energy Integration**: Incorporate renewable energy sources, such as solar, wind, and geothermal, into the urban energy mix.\n",
       "2. **Energy-Efficient Buildings**: Design buildings with energy-efficient systems, materials, and technologies to reduce energy consumption.\n",
       "3. **Smart Grids**: Implement advanced grid management systems that optimize energy distribution, reduce energy losses, and promote energy efficiency.\n",
       "\n",
       "**IV. Water Conservation and Management**\n",
       "\n",
       "1. **Water-Efficient Systems**: Implement water-efficient technologies, such as low-flow appliances and graywater reuse systems.\n",
       "2. **Rainwater Harvesting**: Collect and store rainwater for non-potable uses, such as irrigation and toilet flushing.\n",
       "3. **Flood-Resilient Design**: Design urban infrastructure to withstand flooding, including green infrastructure, flood-resistant construction, and smart stormwater management systems.\n",
       "\n",
       "**V. Waste Reduction and Management**\n",
       "\n",
       "1. **Zero-Waste Policies**: Implement policies and programs to reduce, reuse, and recycle waste, aiming for zero waste to landfill.\n",
       "2. **Circular Economy**: Foster a circular economy by promoting the sharing, leasing, and reuse of products and materials.\n",
       "3. **Waste-to-Energy**: Consider waste-to-energy technologies, such as anaerobic digestion or gasification, to generate energy from waste.\n",
       "\n",
       "**VI. Social Equity and Inclusion**\n",
       "\n",
       "1. **Affordable Housing**: Ensure that a proportion of new housing developments are affordable and accessible to low-income residents.\n",
       "2. **Inclusive Public Spaces**: Design public spaces that are accessible, safe, and welcoming to all members of the community.\n",
       "3. **Community Engagement**: Engage with local communities in the planning and decision-making process to ensure that their needs and concerns are addressed.\n",
       "\n",
       "**VII. Technological Advancements**\n",
       "\n",
       "1. **Smart City Technologies**: Leverage technologies, such as IoT sensors, data analytics, and artificial intelligence, to optimize urban systems and services.\n",
       "2. **Digital Infrastructure**: Invest in digital infrastructure, such as high-speed internet and data storage, to support innovation and entrepreneurship.\n",
       "3. **Emerging Technologies**: Explore the potential of emerging technologies, such as autonomous vehicles, drone delivery, and urban agriculture, to enhance urban sustainability and resilience.\n",
       "\n",
       "**VIII. Economic Growth and Development**\n",
       "\n",
       "1. **Green Economy**: Foster a green economy by promoting sustainable industries, such as renewable energy, sustainable manufacturing, and eco-tourism.\n",
       "2. **Innovation Hubs**: Create innovation hubs and incubators to support start-ups and entrepreneurs working on sustainable solutions.\n",
       "3. **Public-Private Partnerships**: Collaborate with private sector partners to finance and deliver sustainable infrastructure and services.\n",
       "\n",
       "By adopting this comprehensive approach, cities can create a sustainable urban environment that balances economic growth, social equity, and environmental conservation while addressing the challenges of climate change and technological advancements."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "groq = OpenAI(api_key=groq_api_key, base_url=\"https://api.groq.com/openai/v1\")\n",
    "model_name = \"llama-3.3-70b-versatile\"\n",
    "\n",
    "response = groq.chat.completions.create(model=model_name, messages=messages)\n",
    "answer = response.choices[0].message.content\n",
    "\n",
    "display(Markdown(answer))\n",
    "competitors.append(model_name)\n",
    "answers.append(answer)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## For the next cell, we will use Ollama\n",
    "\n",
    "Ollama runs a local web service that gives an OpenAI compatible endpoint,  \n",
    "and runs models locally using high performance C++ code.\n",
    "\n",
    "If you don't have Ollama, install it here by visiting https://ollama.com then pressing Download and following the instructions.\n",
    "\n",
    "After it's installed, you should be able to visit here: http://localhost:11434 and see the message \"Ollama is running\"\n",
    "\n",
    "You might need to restart Cursor (and maybe reboot). Then open a Terminal (control+\\`) and run `ollama serve`\n",
    "\n",
    "Useful Ollama commands (run these in the terminal, or with an exclamation mark in this notebook):\n",
    "\n",
    "`ollama pull <model_name>` downloads a model locally  \n",
    "`ollama ls` lists all the models you've downloaded  \n",
    "`ollama rm <model_name>` deletes the specified model from your downloads"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table style=\"margin: 0; text-align: left; width:100%\">\n",
    "    <tr>\n",
    "        <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",
    "            <img src=\"../assets/stop.png\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
    "        </td>\n",
    "        <td>\n",
    "            <h2 style=\"color:#ff7800;\">Super important - ignore me at your peril!</h2>\n",
    "            <span style=\"color:#ff7800;\">The model called <b>llama3.3</b> is FAR too large for home computers - it's not intended for personal computing and will consume all your resources! Stick with the nicely sized <b>llama3.2</b> or <b>llama3.2:1b</b> and if you want larger, try llama3.1 or smaller variants of Qwen, Gemma, Phi or DeepSeek. See the <A href=\"https://ollama.com/models\">the Ollama models page</a> for a full list of models and sizes.\n",
    "            </span>\n",
    "        </td>\n",
    "    </tr>\n",
    "</table>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Error: could not connect to ollama app, is it running?\n"
     ]
    }
   ],
   "source": [
    "!ollama pull llama3.2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ollama = OpenAI(base_url='http://localhost:11434/v1', api_key='ollama')\n",
    "model_name = \"llama3.2\"\n",
    "\n",
    "response = ollama.chat.completions.create(model=model_name, messages=messages)\n",
    "answer = response.choices[0].message.content\n",
    "\n",
    "display(Markdown(answer))\n",
    "competitors.append(model_name)\n",
    "answers.append(answer)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['gpt-4o-mini', 'claude-3-7-sonnet-latest', 'gemini-2.5-flash', 'deepseek-chat', 'llama-3.3-70b-versatile']\n",
      "['Designing a sustainable urban environment that balances economic growth, social equity, and environmental conservation requires a multifaceted approach. Here are key strategies to consider:\\n\\n### 1. **Integrated Planning Framework**:\\n   - **Holistic Vision**: Develop a comprehensive plan that incorporates long-term goals across economic, social, and environmental dimensions. Utilize systems thinking to understand interdependencies.\\n   - **Stakeholder Engagement**: Involve a diverse group of stakeholders, including citizens, businesses, government agencies, and NGOs, in the planning process to ensure that multiple perspectives are considered.\\n\\n### 2. **Economic Growth**:\\n   - **Sustainable Businesses**: Encourage the establishment of businesses that prioritize sustainability, such as green technologies and local food systems, providing incentives for startups and innovations in renewable energy.\\n   - **Green Jobs**: Invest in job training programs that focus on green technology and sustainable practices to create pathways for employment that contribute to the economy while benefiting the environment.\\n   - **Circular Economy**: Promote a circular economy that minimizes waste and encourages the reuse and recycling of materials.\\n\\n### 3. **Social Equity**:\\n   - **Affordable Housing**: Implement policies that ensure access to affordable, high-quality housing for all residents, prioritizing mixed-income developments.\\n   - **Inclusive Transportation**: Develop public transportation systems that are accessible and affordable, with a focus on reducing reliance on personal vehicles to enhance mobility for all demographic groups.\\n   - **Community Facilities**: Invest in public spaces, parks, and community centers that foster social interaction, well-being, and provide services for all residents, paying particular attention to underrepresented communities.\\n\\n### 4. **Environmental Conservation**:\\n   - **Green Infrastructure**: Incorporate green roofs, urban forests, and permeable surfaces to manage stormwater, reduce urban heat islands, and promote biodiversity.\\n   - **Renewable Energy**: Transition to renewable energy sources, such as solar and wind, and encourage decentralized energy systems that allow communities to manage their energy needs.\\n   - **Sustainable Land Use**: Utilize zoning laws that promote compact, mixed-use developments to limit urban sprawl and protect surrounding natural areas.\\n\\n### 5. **Climate Change Mitigation and Adaptation**:\\n   - **Resilient Infrastructure**: Design infrastructure with resilience in mind, using materials and techniques that withstand climate impacts, such as flooding and extreme temperatures.\\n   - **Climate Action Plans**: Develop and enforce local climate action plans that set emissions reduction targets, promote renewable energy use, and enhance disaster preparedness strategies.\\n   - **Ecosystem Services**: Protect and restore local ecosystems to provide natural solutions to climate change impacts, such as wetlands for flood control and urban trees for air quality improvement.\\n\\n### 6. **Leveraging Technological Advancements**:\\n   - **Smart Cities**: Integrate smart technologies to enhance urban service delivery, efficiency, and sustainability (e.g., smart grids, efficient waste management systems).\\n   - **Data-Driven Decision Making**: Utilize data analytics to monitor environmental impacts, social needs, and economic performance, allowing for agile responses to challenges.\\n   - **Public Engagement Platforms**: Create digital platforms that allow residents to engage in urban planning and communicate their needs and ideas effectively.\\n\\n### 7. **Education and Awareness**:\\n   - **Community Education Programs**: Establish programs that educate citizens about sustainability, resilience, and the importance of social equity in creating a cohesive urban environment.\\n   - **Collaborations with Educational Institutions**: Partner with schools and universities to conduct research, projects, and internships focused on sustainability and urban challenges.\\n\\n### Conclusion\\nThe success of a sustainable urban environment hinges on continuous evaluation and adaptation of strategies in response to emerging challenges and opportunities. By fostering collaboration among stakeholders and leveraging technological advancements, cities can build resilient urban landscapes that thrive economically while ensuring social equity and environmental health. Implementing these strategies holistically will create vibrant communities that are prepared for the future.', '# Designing a Sustainable Urban Environment\\n\\nMy approach would integrate multiple dimensions of sustainability through these key strategies:\\n\\n## Foundational Planning Principles\\n- Implement **mixed-use zoning** to reduce commute distances and create vibrant neighborhoods\\n- Adopt **circular economy models** where waste becomes a resource\\n- Design for **climate resilience** with infrastructure that anticipates extreme weather events\\n- Use **systems thinking** to understand how transportation, housing, energy, and social systems interact\\n\\n## Environmental Strategies\\n- Develop **green infrastructure networks** (urban forests, bioswales, green roofs)\\n- Transition to **renewable energy** with district systems and microgrids\\n- Prioritize **water-sensitive urban design** for conservation and flood management\\n- Create **biodiversity corridors** connecting urban green spaces\\n\\n## Social Equity Considerations\\n- Ensure **affordable housing** across all neighborhoods through inclusionary zoning\\n- Design **accessible public spaces** that accommodate diverse needs and ages\\n- Implement **participatory planning processes** centering marginalized communities\\n- Distribute **environmental amenities equitably** to prevent \"green gentrification\"\\n\\n## Economic Framework\\n- Support **local businesses and circular economies** through procurement policies\\n- Invest in **green jobs training** for marginalized communities\\n- Create **innovation districts** for sustainable technology development\\n- Use **progressive taxation** to fund public infrastructure and services\\n\\n## Technology Integration\\n- Deploy **smart city infrastructure** that respects privacy and reduces consumption\\n- Implement **digital inclusion programs** to ensure equitable technology access\\n- Use **data analytics** to optimize resource use and service delivery\\n\\nSuccess would ultimately depend on collaborative governance involving diverse stakeholders and continuous adaptation as conditions evolve.', 'Designing a sustainable urban environment that truly balances economic growth, social equity, and environmental conservation, while also factoring in climate change and technological advancements, requires a holistic, integrated, and adaptive approach. It\\'s not a static blueprint but a dynamic framework for continuous evolution.\\n\\nHere\\'s a comprehensive approach:\\n\\n---\\n\\n## **A Holistic Approach to Sustainable Urban Design**\\n\\nThe core principle is **systems thinking**, recognizing that all elements of the city are interconnected. Changes in one area will inevitably impact others.\\n\\n### **Phase 1: Visioning, Assessment & Stakeholder Engagement**\\n\\n1.  **Comprehensive Baseline Assessment:**\\n    *   **Environmental:** Current emissions, air/water quality, biodiversity, resource consumption (energy, water, waste), vulnerability to climate hazards (flooding, heatwaves, sea-level rise).\\n    *   **Economic:** Key industries, employment rates, income distribution, existing infrastructure, innovation capacity.\\n    *   **Social:** Demographics, housing affordability, access to services (education, healthcare, transport), green spaces, public safety, social cohesion, digital literacy.\\n    *   **Technological:** Existing infrastructure, digital divide, local innovation ecosystem.\\n\\n2.  **Inclusive Stakeholder Engagement:**\\n    *   **Government:** All levels (municipal, regional, national).\\n    *   **Private Sector:** Businesses, industries, developers, tech companies.\\n    *   **Academia & Research:** Universities, think tanks for data, innovation, and expertise.\\n    *   **Civil Society:** NGOs, community groups, residents (especially marginalized communities), youth.\\n    *   **Purpose:** Co-create a shared vision, identify priorities, gather diverse perspectives, build consensus, and foster ownership. This is crucial for ensuring social equity is embedded from the start.\\n\\n3.  **Define Goals & Key Performance Indicators (KPIs):**\\n    *   Establish measurable, time-bound targets for all three pillars (e.g., X% reduction in emissions by 20XX, X% affordable housing, Y% green space per capita, Z% local job creation).\\n    *   Include climate resilience metrics (e.g., reduced flood risk, increased permeable surfaces).\\n\\n### **Phase 2: Integrated Design & Planning Principles**\\n\\nThis phase translates the vision into actionable plans, emphasizing cross-sectoral integration.\\n\\n1.  **Eco-Centric Infrastructure & Urban Planning:**\\n    *   **Energy:** Transition to 100% renewable energy sources (solar, wind, geothermal). Implement smart grids, demand-side management, energy efficiency standards for buildings, and district heating/cooling. Promote decentralized energy generation.\\n    *   **Water:** Implement integrated water management (IWM) – closed-loop systems, rainwater harvesting, greywater recycling, wastewater treatment for reuse, permeable surfaces to reduce runoff and replenish groundwater. Protect natural water bodies.\\n    *   **Waste:** Move towards a circular economy model. Drastically reduce waste generation, maximize reuse and recycling, promote composting, and explore waste-to-energy where appropriate (as a last resort after reduction/reuse).\\n    *   **Green & Blue Infrastructure:** Prioritize green spaces (parks, urban forests, vertical gardens) and blue spaces (rivers, canals, ponds) for biodiversity, air purification, urban cooling (combating heat islands), stormwater management, and public well-being. Create ecological corridors.\\n    *   **Sustainable Mobility:** Design for transit-oriented development (TOD). Prioritize walking, cycling, and robust, efficient, and accessible public transport (electric buses/trams, high-speed rail connections). Discourage private car use through infrastructure and policy (e.g., congestion pricing). Promote shared mobility services (bikes, EVs).\\n    *   **Sustainable Buildings:** Mandate high standards for energy efficiency, passive design, use of local and recycled materials, green roofs/walls, and water conservation in all new and renovated buildings.\\n\\n2.  **Economic Growth through Sustainability:**\\n    *   **Green Economy Development:** Foster industries related to renewable energy, sustainable manufacturing, ecological restoration, green technology, and circular economy solutions. This creates new jobs and economic diversification.\\n    *   **Local & Resilient Supply Chains:** Support local businesses, urban agriculture, and short supply chains to reduce transport emissions, build community wealth, and enhance resilience to external shocks.\\n    *   **Innovation Hubs:** Create dedicated zones for R&D in green tech, smart city solutions, and sustainable materials, fostering collaboration between academia, startups, and established companies.\\n    *   **Resource Efficiency as Economic Driver:** Demonstrate how reducing energy, water, and waste consumption leads to significant cost savings for businesses and residents, making the city more competitive and attractive for investment.\\n\\n3.  **Social Equity at the Core:**\\n    *   **Affordable & Inclusive Housing:** Implement policies for mixed-income developments, inclusionary zoning, and social housing initiatives to prevent gentrification and ensure housing access for all income levels. Design diverse housing types.\\n    *   **Equitable Access to Services:** Ensure all residents have easy access to quality education, healthcare, public transport, green spaces, cultural facilities, and healthy food options, regardless of income or neighborhood.\\n    *   **Participatory Governance:** Establish ongoing mechanisms for citizen engagement in planning, decision-making, and oversight. Empower local communities.\\n    *   **Digital Inclusion:** Bridge the digital divide by ensuring universal access to affordable high-speed internet and digital literacy programs, enabling participation in the smart city and access to services.\\n    *   **Health & Wellbeing:** Design for walkable neighborhoods, safe public spaces, clean air, and access to nature to promote physical and mental health. Address noise pollution.\\n\\n4.  **Climate Change Mitigation & Adaptation:**\\n    *   **Mitigation:** Directly addressed by the environmental conservation strategies (renewable energy, sustainable transport, waste reduction). Set ambitious carbon neutrality targets.\\n    *   **Adaptation & Resilience:**\\n        *   **Infrastructure:** Design climate-resilient infrastructure (e.g., elevated roads in flood zones, heat-resistant materials, decentralized energy for grid resilience).\\n        *   **Nature-Based Solutions:** Utilize green and blue infrastructure for flood protection, heat island mitigation (e.g., street trees, permeable pavements), and shoreline protection.\\n        *   **Early Warning Systems:** Implement advanced sensor networks and data analytics for real-time monitoring of weather patterns, air quality, and potential hazards, providing timely alerts to residents.\\n        *   **Emergency Preparedness:** Develop robust disaster response plans and community-level resilience programs.\\n        *   **Water Security:** Plan for drought resilience through diversified water sources and efficient use.\\n\\n5.  **Leveraging Technological Advancements:**\\n    *   **Smart City Technologies:** Utilize IoT sensors, AI, and big data analytics for:\\n        *   **Resource Management:** Optimize energy use (smart grids), water distribution, and waste collection.\\n        *   **Traffic Management:** Reduce congestion and emissions.\\n        *   **Environmental Monitoring:** Real-time air/water quality, noise levels, heat maps.\\n        *   **Public Safety:** Enhanced security and emergency response.\\n    *   **Digital Platforms for Citizen Engagement:** Develop accessible online platforms for participatory planning, feedback, and service delivery.\\n    *   **Advanced Materials:** Research and implement sustainable, durable, and low-carbon building materials (e.g., self-healing concrete, bio-based materials).\\n    *   **Autonomous Vehicles/Drones:** Explore their potential for optimized public transport, last-mile delivery, and infrastructure inspection (while managing potential social/environmental impacts).\\n    *   **Digital Twin Technology:** Create virtual models of the city to simulate different scenarios (e.g., flood impacts, traffic flow, energy consumption) and test design interventions before implementation.\\n\\n### **Phase 3: Governance, Policies & Implementation**\\n\\n1.  **Integrated Governance Model:** Establish a cross-departmental task force or agency responsible for overseeing sustainable urban development, breaking down traditional silos.\\n2.  **Policy & Regulatory Framework:**\\n    *   Incentivize sustainable practices (tax breaks for green buildings, subsidies for renewables).\\n    *   Mandate environmental performance standards.\\n    *   Implement carbon pricing or emissions trading schemes.\\n    *   Streamline permitting for sustainable projects.\\n    *   Robust zoning laws that encourage mixed-use development and protect green spaces.\\n3.  **Financing & Investment:**\\n    *   Attract green finance, impact investors, and public-private partnerships.\\n    *   Explore municipal green bonds.\\n    *   Leverage national and international climate funds.\\n4.  **Pilot Projects & Scalability:** Start with small, manageable pilot projects to test concepts, gather data, and demonstrate success before scaling up.\\n5.  **Education & Capacity Building:** Invest in training for urban planners, engineers, policymakers, and the public on sustainable practices and climate change.\\n\\n### **Phase 4: Monitoring, Evaluation & Adaptive Management**\\n\\n1.  **Continuous Monitoring:** Regularly track progress against established KPIs using data from sensors, citizen feedback, and traditional surveys.\\n2.  **Regular Review & Evaluation:** Conduct periodic reviews to assess the effectiveness of policies and interventions.\\n3.  **Adaptive Management:** Be prepared to adjust strategies and plans based on monitoring data, emerging technologies, unforeseen challenges, and evolving community needs. This is critical for long-term resilience and flexibility in the face of rapid change.\\n4.  **Transparency & Reporting:** Publish regular reports on the city\\'s sustainability performance, fostering accountability and public trust.\\n\\n---\\n\\n**Challenges & Balancing Act:**\\n\\nThe biggest challenge is often the **trade-offs**. For example:\\n*   Economic growth often historically came at an environmental cost. The design must demonstrate how green economy can *drive* growth.\\n*   New infrastructure might displace communities; social equity demands robust resettlement plans and community benefit agreements.\\n*   Technological advancements raise privacy concerns; robust data governance and ethical AI principles are crucial.\\n\\nThe \"balancing act\" is achieved not by compromising on each pillar, but by finding **synergies** where they reinforce each other. A healthy environment supports a productive economy and human well-being. A vibrant economy can fund sustainable infrastructure and social programs. Social equity ensures that the benefits of sustainability are shared by all, fostering a more resilient and cohesive community capable of adapting to future challenges.', 'Designing a sustainable urban environment that balances economic growth, social equity, and environmental conservation—while addressing climate change and leveraging technology—requires a holistic, systems-thinking approach. Here’s a step-by-step framework:\\n\\n### **1. Vision and Stakeholder Engagement**  \\n- **Define Shared Goals**: Establish a clear vision integrating sustainability, equity, and resilience (e.g., carbon neutrality by 2050, zero displacement, green job creation).  \\n- **Participatory Planning**: Engage communities, businesses, NGOs, and policymakers to ensure diverse needs are met (e.g., co-design workshops, digital platforms for feedback).  \\n\\n### **2. Compact, Mixed-Use Urban Design**  \\n- **Transit-Oriented Development (TOD)**: Prioritize dense, walkable neighborhoods with mixed-income housing near public transit to reduce car dependency.  \\n- **15-Minute City Concept**: Ensure access to jobs, schools, healthcare, and recreation within short distances.  \\n- **Green Infrastructure**: Integrate parks, urban forests, and green roofs to mitigate heat islands and manage stormwater.  \\n\\n### **3. Climate-Resilient Infrastructure**  \\n- **Adaptive Buildings**: Mandate net-zero energy designs, passive cooling, and flood-resistant materials.  \\n- **Renewable Energy Microgrids**: Decentralize energy with solar/wind + battery storage to enhance resilience.  \\n- **Blue-Green Systems**: Use permeable pavements, bioswales, and restored wetlands to combat flooding.  \\n\\n### **4. Equitable Economic Growth**  \\n- **Green Jobs & Training**: Invest in renewable energy, circular economy (recycling, upcycling), and local agriculture.  \\n- **Inclusive Zoning**: Reserve affordable housing units and protect against gentrification (e.g., community land trusts).  \\n- **Support for Informal Sectors**: Integrate street vendors and gig workers into formal urban plans.  \\n\\n### **5. Smart & Low-Carbon Mobility**  \\n- **Prioritize Public Transit**: Electric buses, bike lanes, and pedestrian-friendly streets.  \\n- **Shared Mobility**: Promote carpooling, e-scooters, and autonomous shuttles to reduce private car ownership.  \\n- **Freight Electrification**: Transition delivery fleets to EVs and optimize logistics with AI.  \\n\\n### **6. Circular Economy & Resource Efficiency**  \\n- **Zero-Waste Systems**: Incentivize composting, recycling, and industrial symbiosis (waste = resource).  \\n- **Water Reuse**: Implement greywater recycling and rainwater harvesting.  \\n- **Sustainable Materials**: Use low-carbon concrete, recycled steel, and modular construction.  \\n\\n### **7. Technology for Sustainability & Equity**  \\n- **Digital Twins**: Model urban systems (energy, traffic) to optimize planning.  \\n- **IoT Sensors**: Monitor air quality, water use, and energy consumption in real time.  \\n- **AI for Equity**: Use data to identify underserved areas (e.g., food deserts, transit gaps).  \\n\\n### **8. Governance & Policy Innovation**  \\n- **Carbon Pricing & Green Bonds**: Fund sustainability projects via taxes on emissions/pollution.  \\n- **Inclusive Policies**: Mandate social impact assessments for new developments.  \\n- **Regional Collaboration**: Coordinate with neighboring cities on shared resources (water, energy grids).  \\n\\n### **9. Monitoring & Adaptive Management**  \\n- **KPIs for Success**: Track metrics like GHG reductions, air quality, job creation, and affordability.  \\n- **Iterative Feedback**: Use citizen science and digital dashboards to refine strategies.  \\n\\n### **Example: Copenhagen’s 2025 Carbon Neutral Plan**  \\n- **Biking Infrastructure**: 50% commute by bike.  \\n- **District Heating**: 98% from renewables.  \\n- **Climate Adaptation**: Parks double as flood basins.  \\n\\n### **Key Trade-offs to Manage**  \\n- **Density vs. Green Space**: High density reduces sprawl but requires careful green integration.  \\n- **Tech vs. Privacy**: Smart cities must protect data rights.  \\n- **Growth vs. Equity**: Ensure economic expansion doesn’t displace vulnerable groups.  \\n\\nBy integrating these strategies, cities can become **prosperous, fair, and regenerative**—future-proofing against climate risks while improving quality of life. Would you like a deeper dive into any specific aspect?', \"Designing a sustainable urban environment requires a holistic approach that balances economic growth, social equity, and environmental conservation while considering the impact of climate change and technological advancements. Here's a comprehensive approach to achieve this balance:\\n\\n**I. Climate-Resilient Urban Planning**\\n\\n1. **Green Infrastructure**: Incorporate green spaces, parks, and green roofs to mitigate urban heat islands, manage stormwater runoff, and improve air quality.\\n2. **Climate-Resilient Design**: Design buildings and infrastructure to withstand extreme weather events, such as sea-level rise, flooding, and droughts.\\n3. **Adaptive Urban Planning**: Develop flexible and adaptable urban plans that can respond to changing climate conditions and emerging technologies.\\n\\n**II. Sustainable Transportation Systems**\\n\\n1. **Electrification of Transportation**: Promote the adoption of electric vehicles, public transportation, and non-motorized transportation options, such as walking and cycling.\\n2. **Smart Traffic Management**: Implement intelligent transportation systems that optimize traffic flow, reduce congestion, and minimize emissions.\\n3. **Multimodal Transportation**: Encourage the use of multiple transportation modes, including public transportation, walking, and cycling, to reduce reliance on personal vehicles.\\n\\n**III. Energy-Efficient and Renewable Energy Systems**\\n\\n1. **Renewable Energy Integration**: Incorporate renewable energy sources, such as solar, wind, and geothermal, into the urban energy mix.\\n2. **Energy-Efficient Buildings**: Design buildings with energy-efficient systems, materials, and technologies to reduce energy consumption.\\n3. **Smart Grids**: Implement advanced grid management systems that optimize energy distribution, reduce energy losses, and promote energy efficiency.\\n\\n**IV. Water Conservation and Management**\\n\\n1. **Water-Efficient Systems**: Implement water-efficient technologies, such as low-flow appliances and graywater reuse systems.\\n2. **Rainwater Harvesting**: Collect and store rainwater for non-potable uses, such as irrigation and toilet flushing.\\n3. **Flood-Resilient Design**: Design urban infrastructure to withstand flooding, including green infrastructure, flood-resistant construction, and smart stormwater management systems.\\n\\n**V. Waste Reduction and Management**\\n\\n1. **Zero-Waste Policies**: Implement policies and programs to reduce, reuse, and recycle waste, aiming for zero waste to landfill.\\n2. **Circular Economy**: Foster a circular economy by promoting the sharing, leasing, and reuse of products and materials.\\n3. **Waste-to-Energy**: Consider waste-to-energy technologies, such as anaerobic digestion or gasification, to generate energy from waste.\\n\\n**VI. Social Equity and Inclusion**\\n\\n1. **Affordable Housing**: Ensure that a proportion of new housing developments are affordable and accessible to low-income residents.\\n2. **Inclusive Public Spaces**: Design public spaces that are accessible, safe, and welcoming to all members of the community.\\n3. **Community Engagement**: Engage with local communities in the planning and decision-making process to ensure that their needs and concerns are addressed.\\n\\n**VII. Technological Advancements**\\n\\n1. **Smart City Technologies**: Leverage technologies, such as IoT sensors, data analytics, and artificial intelligence, to optimize urban systems and services.\\n2. **Digital Infrastructure**: Invest in digital infrastructure, such as high-speed internet and data storage, to support innovation and entrepreneurship.\\n3. **Emerging Technologies**: Explore the potential of emerging technologies, such as autonomous vehicles, drone delivery, and urban agriculture, to enhance urban sustainability and resilience.\\n\\n**VIII. Economic Growth and Development**\\n\\n1. **Green Economy**: Foster a green economy by promoting sustainable industries, such as renewable energy, sustainable manufacturing, and eco-tourism.\\n2. **Innovation Hubs**: Create innovation hubs and incubators to support start-ups and entrepreneurs working on sustainable solutions.\\n3. **Public-Private Partnerships**: Collaborate with private sector partners to finance and deliver sustainable infrastructure and services.\\n\\nBy adopting this comprehensive approach, cities can create a sustainable urban environment that balances economic growth, social equity, and environmental conservation while addressing the challenges of climate change and technological advancements.\"]\n"
     ]
    }
   ],
   "source": [
    "# So where are we?\n",
    "\n",
    "print(competitors)\n",
    "print(answers)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Competitor: gpt-4o-mini\n",
      "\n",
      "Designing a sustainable urban environment that balances economic growth, social equity, and environmental conservation requires a multifaceted approach. Here are key strategies to consider:\n",
      "\n",
      "### 1. **Integrated Planning Framework**:\n",
      "   - **Holistic Vision**: Develop a comprehensive plan that incorporates long-term goals across economic, social, and environmental dimensions. Utilize systems thinking to understand interdependencies.\n",
      "   - **Stakeholder Engagement**: Involve a diverse group of stakeholders, including citizens, businesses, government agencies, and NGOs, in the planning process to ensure that multiple perspectives are considered.\n",
      "\n",
      "### 2. **Economic Growth**:\n",
      "   - **Sustainable Businesses**: Encourage the establishment of businesses that prioritize sustainability, such as green technologies and local food systems, providing incentives for startups and innovations in renewable energy.\n",
      "   - **Green Jobs**: Invest in job training programs that focus on green technology and sustainable practices to create pathways for employment that contribute to the economy while benefiting the environment.\n",
      "   - **Circular Economy**: Promote a circular economy that minimizes waste and encourages the reuse and recycling of materials.\n",
      "\n",
      "### 3. **Social Equity**:\n",
      "   - **Affordable Housing**: Implement policies that ensure access to affordable, high-quality housing for all residents, prioritizing mixed-income developments.\n",
      "   - **Inclusive Transportation**: Develop public transportation systems that are accessible and affordable, with a focus on reducing reliance on personal vehicles to enhance mobility for all demographic groups.\n",
      "   - **Community Facilities**: Invest in public spaces, parks, and community centers that foster social interaction, well-being, and provide services for all residents, paying particular attention to underrepresented communities.\n",
      "\n",
      "### 4. **Environmental Conservation**:\n",
      "   - **Green Infrastructure**: Incorporate green roofs, urban forests, and permeable surfaces to manage stormwater, reduce urban heat islands, and promote biodiversity.\n",
      "   - **Renewable Energy**: Transition to renewable energy sources, such as solar and wind, and encourage decentralized energy systems that allow communities to manage their energy needs.\n",
      "   - **Sustainable Land Use**: Utilize zoning laws that promote compact, mixed-use developments to limit urban sprawl and protect surrounding natural areas.\n",
      "\n",
      "### 5. **Climate Change Mitigation and Adaptation**:\n",
      "   - **Resilient Infrastructure**: Design infrastructure with resilience in mind, using materials and techniques that withstand climate impacts, such as flooding and extreme temperatures.\n",
      "   - **Climate Action Plans**: Develop and enforce local climate action plans that set emissions reduction targets, promote renewable energy use, and enhance disaster preparedness strategies.\n",
      "   - **Ecosystem Services**: Protect and restore local ecosystems to provide natural solutions to climate change impacts, such as wetlands for flood control and urban trees for air quality improvement.\n",
      "\n",
      "### 6. **Leveraging Technological Advancements**:\n",
      "   - **Smart Cities**: Integrate smart technologies to enhance urban service delivery, efficiency, and sustainability (e.g., smart grids, efficient waste management systems).\n",
      "   - **Data-Driven Decision Making**: Utilize data analytics to monitor environmental impacts, social needs, and economic performance, allowing for agile responses to challenges.\n",
      "   - **Public Engagement Platforms**: Create digital platforms that allow residents to engage in urban planning and communicate their needs and ideas effectively.\n",
      "\n",
      "### 7. **Education and Awareness**:\n",
      "   - **Community Education Programs**: Establish programs that educate citizens about sustainability, resilience, and the importance of social equity in creating a cohesive urban environment.\n",
      "   - **Collaborations with Educational Institutions**: Partner with schools and universities to conduct research, projects, and internships focused on sustainability and urban challenges.\n",
      "\n",
      "### Conclusion\n",
      "The success of a sustainable urban environment hinges on continuous evaluation and adaptation of strategies in response to emerging challenges and opportunities. By fostering collaboration among stakeholders and leveraging technological advancements, cities can build resilient urban landscapes that thrive economically while ensuring social equity and environmental health. Implementing these strategies holistically will create vibrant communities that are prepared for the future.\n",
      "Competitor: claude-3-7-sonnet-latest\n",
      "\n",
      "# Designing a Sustainable Urban Environment\n",
      "\n",
      "My approach would integrate multiple dimensions of sustainability through these key strategies:\n",
      "\n",
      "## Foundational Planning Principles\n",
      "- Implement **mixed-use zoning** to reduce commute distances and create vibrant neighborhoods\n",
      "- Adopt **circular economy models** where waste becomes a resource\n",
      "- Design for **climate resilience** with infrastructure that anticipates extreme weather events\n",
      "- Use **systems thinking** to understand how transportation, housing, energy, and social systems interact\n",
      "\n",
      "## Environmental Strategies\n",
      "- Develop **green infrastructure networks** (urban forests, bioswales, green roofs)\n",
      "- Transition to **renewable energy** with district systems and microgrids\n",
      "- Prioritize **water-sensitive urban design** for conservation and flood management\n",
      "- Create **biodiversity corridors** connecting urban green spaces\n",
      "\n",
      "## Social Equity Considerations\n",
      "- Ensure **affordable housing** across all neighborhoods through inclusionary zoning\n",
      "- Design **accessible public spaces** that accommodate diverse needs and ages\n",
      "- Implement **participatory planning processes** centering marginalized communities\n",
      "- Distribute **environmental amenities equitably** to prevent \"green gentrification\"\n",
      "\n",
      "## Economic Framework\n",
      "- Support **local businesses and circular economies** through procurement policies\n",
      "- Invest in **green jobs training** for marginalized communities\n",
      "- Create **innovation districts** for sustainable technology development\n",
      "- Use **progressive taxation** to fund public infrastructure and services\n",
      "\n",
      "## Technology Integration\n",
      "- Deploy **smart city infrastructure** that respects privacy and reduces consumption\n",
      "- Implement **digital inclusion programs** to ensure equitable technology access\n",
      "- Use **data analytics** to optimize resource use and service delivery\n",
      "\n",
      "Success would ultimately depend on collaborative governance involving diverse stakeholders and continuous adaptation as conditions evolve.\n",
      "Competitor: gemini-2.5-flash\n",
      "\n",
      "Designing a sustainable urban environment that truly balances economic growth, social equity, and environmental conservation, while also factoring in climate change and technological advancements, requires a holistic, integrated, and adaptive approach. It's not a static blueprint but a dynamic framework for continuous evolution.\n",
      "\n",
      "Here's a comprehensive approach:\n",
      "\n",
      "---\n",
      "\n",
      "## **A Holistic Approach to Sustainable Urban Design**\n",
      "\n",
      "The core principle is **systems thinking**, recognizing that all elements of the city are interconnected. Changes in one area will inevitably impact others.\n",
      "\n",
      "### **Phase 1: Visioning, Assessment & Stakeholder Engagement**\n",
      "\n",
      "1.  **Comprehensive Baseline Assessment:**\n",
      "    *   **Environmental:** Current emissions, air/water quality, biodiversity, resource consumption (energy, water, waste), vulnerability to climate hazards (flooding, heatwaves, sea-level rise).\n",
      "    *   **Economic:** Key industries, employment rates, income distribution, existing infrastructure, innovation capacity.\n",
      "    *   **Social:** Demographics, housing affordability, access to services (education, healthcare, transport), green spaces, public safety, social cohesion, digital literacy.\n",
      "    *   **Technological:** Existing infrastructure, digital divide, local innovation ecosystem.\n",
      "\n",
      "2.  **Inclusive Stakeholder Engagement:**\n",
      "    *   **Government:** All levels (municipal, regional, national).\n",
      "    *   **Private Sector:** Businesses, industries, developers, tech companies.\n",
      "    *   **Academia & Research:** Universities, think tanks for data, innovation, and expertise.\n",
      "    *   **Civil Society:** NGOs, community groups, residents (especially marginalized communities), youth.\n",
      "    *   **Purpose:** Co-create a shared vision, identify priorities, gather diverse perspectives, build consensus, and foster ownership. This is crucial for ensuring social equity is embedded from the start.\n",
      "\n",
      "3.  **Define Goals & Key Performance Indicators (KPIs):**\n",
      "    *   Establish measurable, time-bound targets for all three pillars (e.g., X% reduction in emissions by 20XX, X% affordable housing, Y% green space per capita, Z% local job creation).\n",
      "    *   Include climate resilience metrics (e.g., reduced flood risk, increased permeable surfaces).\n",
      "\n",
      "### **Phase 2: Integrated Design & Planning Principles**\n",
      "\n",
      "This phase translates the vision into actionable plans, emphasizing cross-sectoral integration.\n",
      "\n",
      "1.  **Eco-Centric Infrastructure & Urban Planning:**\n",
      "    *   **Energy:** Transition to 100% renewable energy sources (solar, wind, geothermal). Implement smart grids, demand-side management, energy efficiency standards for buildings, and district heating/cooling. Promote decentralized energy generation.\n",
      "    *   **Water:** Implement integrated water management (IWM) – closed-loop systems, rainwater harvesting, greywater recycling, wastewater treatment for reuse, permeable surfaces to reduce runoff and replenish groundwater. Protect natural water bodies.\n",
      "    *   **Waste:** Move towards a circular economy model. Drastically reduce waste generation, maximize reuse and recycling, promote composting, and explore waste-to-energy where appropriate (as a last resort after reduction/reuse).\n",
      "    *   **Green & Blue Infrastructure:** Prioritize green spaces (parks, urban forests, vertical gardens) and blue spaces (rivers, canals, ponds) for biodiversity, air purification, urban cooling (combating heat islands), stormwater management, and public well-being. Create ecological corridors.\n",
      "    *   **Sustainable Mobility:** Design for transit-oriented development (TOD). Prioritize walking, cycling, and robust, efficient, and accessible public transport (electric buses/trams, high-speed rail connections). Discourage private car use through infrastructure and policy (e.g., congestion pricing). Promote shared mobility services (bikes, EVs).\n",
      "    *   **Sustainable Buildings:** Mandate high standards for energy efficiency, passive design, use of local and recycled materials, green roofs/walls, and water conservation in all new and renovated buildings.\n",
      "\n",
      "2.  **Economic Growth through Sustainability:**\n",
      "    *   **Green Economy Development:** Foster industries related to renewable energy, sustainable manufacturing, ecological restoration, green technology, and circular economy solutions. This creates new jobs and economic diversification.\n",
      "    *   **Local & Resilient Supply Chains:** Support local businesses, urban agriculture, and short supply chains to reduce transport emissions, build community wealth, and enhance resilience to external shocks.\n",
      "    *   **Innovation Hubs:** Create dedicated zones for R&D in green tech, smart city solutions, and sustainable materials, fostering collaboration between academia, startups, and established companies.\n",
      "    *   **Resource Efficiency as Economic Driver:** Demonstrate how reducing energy, water, and waste consumption leads to significant cost savings for businesses and residents, making the city more competitive and attractive for investment.\n",
      "\n",
      "3.  **Social Equity at the Core:**\n",
      "    *   **Affordable & Inclusive Housing:** Implement policies for mixed-income developments, inclusionary zoning, and social housing initiatives to prevent gentrification and ensure housing access for all income levels. Design diverse housing types.\n",
      "    *   **Equitable Access to Services:** Ensure all residents have easy access to quality education, healthcare, public transport, green spaces, cultural facilities, and healthy food options, regardless of income or neighborhood.\n",
      "    *   **Participatory Governance:** Establish ongoing mechanisms for citizen engagement in planning, decision-making, and oversight. Empower local communities.\n",
      "    *   **Digital Inclusion:** Bridge the digital divide by ensuring universal access to affordable high-speed internet and digital literacy programs, enabling participation in the smart city and access to services.\n",
      "    *   **Health & Wellbeing:** Design for walkable neighborhoods, safe public spaces, clean air, and access to nature to promote physical and mental health. Address noise pollution.\n",
      "\n",
      "4.  **Climate Change Mitigation & Adaptation:**\n",
      "    *   **Mitigation:** Directly addressed by the environmental conservation strategies (renewable energy, sustainable transport, waste reduction). Set ambitious carbon neutrality targets.\n",
      "    *   **Adaptation & Resilience:**\n",
      "        *   **Infrastructure:** Design climate-resilient infrastructure (e.g., elevated roads in flood zones, heat-resistant materials, decentralized energy for grid resilience).\n",
      "        *   **Nature-Based Solutions:** Utilize green and blue infrastructure for flood protection, heat island mitigation (e.g., street trees, permeable pavements), and shoreline protection.\n",
      "        *   **Early Warning Systems:** Implement advanced sensor networks and data analytics for real-time monitoring of weather patterns, air quality, and potential hazards, providing timely alerts to residents.\n",
      "        *   **Emergency Preparedness:** Develop robust disaster response plans and community-level resilience programs.\n",
      "        *   **Water Security:** Plan for drought resilience through diversified water sources and efficient use.\n",
      "\n",
      "5.  **Leveraging Technological Advancements:**\n",
      "    *   **Smart City Technologies:** Utilize IoT sensors, AI, and big data analytics for:\n",
      "        *   **Resource Management:** Optimize energy use (smart grids), water distribution, and waste collection.\n",
      "        *   **Traffic Management:** Reduce congestion and emissions.\n",
      "        *   **Environmental Monitoring:** Real-time air/water quality, noise levels, heat maps.\n",
      "        *   **Public Safety:** Enhanced security and emergency response.\n",
      "    *   **Digital Platforms for Citizen Engagement:** Develop accessible online platforms for participatory planning, feedback, and service delivery.\n",
      "    *   **Advanced Materials:** Research and implement sustainable, durable, and low-carbon building materials (e.g., self-healing concrete, bio-based materials).\n",
      "    *   **Autonomous Vehicles/Drones:** Explore their potential for optimized public transport, last-mile delivery, and infrastructure inspection (while managing potential social/environmental impacts).\n",
      "    *   **Digital Twin Technology:** Create virtual models of the city to simulate different scenarios (e.g., flood impacts, traffic flow, energy consumption) and test design interventions before implementation.\n",
      "\n",
      "### **Phase 3: Governance, Policies & Implementation**\n",
      "\n",
      "1.  **Integrated Governance Model:** Establish a cross-departmental task force or agency responsible for overseeing sustainable urban development, breaking down traditional silos.\n",
      "2.  **Policy & Regulatory Framework:**\n",
      "    *   Incentivize sustainable practices (tax breaks for green buildings, subsidies for renewables).\n",
      "    *   Mandate environmental performance standards.\n",
      "    *   Implement carbon pricing or emissions trading schemes.\n",
      "    *   Streamline permitting for sustainable projects.\n",
      "    *   Robust zoning laws that encourage mixed-use development and protect green spaces.\n",
      "3.  **Financing & Investment:**\n",
      "    *   Attract green finance, impact investors, and public-private partnerships.\n",
      "    *   Explore municipal green bonds.\n",
      "    *   Leverage national and international climate funds.\n",
      "4.  **Pilot Projects & Scalability:** Start with small, manageable pilot projects to test concepts, gather data, and demonstrate success before scaling up.\n",
      "5.  **Education & Capacity Building:** Invest in training for urban planners, engineers, policymakers, and the public on sustainable practices and climate change.\n",
      "\n",
      "### **Phase 4: Monitoring, Evaluation & Adaptive Management**\n",
      "\n",
      "1.  **Continuous Monitoring:** Regularly track progress against established KPIs using data from sensors, citizen feedback, and traditional surveys.\n",
      "2.  **Regular Review & Evaluation:** Conduct periodic reviews to assess the effectiveness of policies and interventions.\n",
      "3.  **Adaptive Management:** Be prepared to adjust strategies and plans based on monitoring data, emerging technologies, unforeseen challenges, and evolving community needs. This is critical for long-term resilience and flexibility in the face of rapid change.\n",
      "4.  **Transparency & Reporting:** Publish regular reports on the city's sustainability performance, fostering accountability and public trust.\n",
      "\n",
      "---\n",
      "\n",
      "**Challenges & Balancing Act:**\n",
      "\n",
      "The biggest challenge is often the **trade-offs**. For example:\n",
      "*   Economic growth often historically came at an environmental cost. The design must demonstrate how green economy can *drive* growth.\n",
      "*   New infrastructure might displace communities; social equity demands robust resettlement plans and community benefit agreements.\n",
      "*   Technological advancements raise privacy concerns; robust data governance and ethical AI principles are crucial.\n",
      "\n",
      "The \"balancing act\" is achieved not by compromising on each pillar, but by finding **synergies** where they reinforce each other. A healthy environment supports a productive economy and human well-being. A vibrant economy can fund sustainable infrastructure and social programs. Social equity ensures that the benefits of sustainability are shared by all, fostering a more resilient and cohesive community capable of adapting to future challenges.\n",
      "Competitor: deepseek-chat\n",
      "\n",
      "Designing a sustainable urban environment that balances economic growth, social equity, and environmental conservation—while addressing climate change and leveraging technology—requires a holistic, systems-thinking approach. Here’s a step-by-step framework:\n",
      "\n",
      "### **1. Vision and Stakeholder Engagement**  \n",
      "- **Define Shared Goals**: Establish a clear vision integrating sustainability, equity, and resilience (e.g., carbon neutrality by 2050, zero displacement, green job creation).  \n",
      "- **Participatory Planning**: Engage communities, businesses, NGOs, and policymakers to ensure diverse needs are met (e.g., co-design workshops, digital platforms for feedback).  \n",
      "\n",
      "### **2. Compact, Mixed-Use Urban Design**  \n",
      "- **Transit-Oriented Development (TOD)**: Prioritize dense, walkable neighborhoods with mixed-income housing near public transit to reduce car dependency.  \n",
      "- **15-Minute City Concept**: Ensure access to jobs, schools, healthcare, and recreation within short distances.  \n",
      "- **Green Infrastructure**: Integrate parks, urban forests, and green roofs to mitigate heat islands and manage stormwater.  \n",
      "\n",
      "### **3. Climate-Resilient Infrastructure**  \n",
      "- **Adaptive Buildings**: Mandate net-zero energy designs, passive cooling, and flood-resistant materials.  \n",
      "- **Renewable Energy Microgrids**: Decentralize energy with solar/wind + battery storage to enhance resilience.  \n",
      "- **Blue-Green Systems**: Use permeable pavements, bioswales, and restored wetlands to combat flooding.  \n",
      "\n",
      "### **4. Equitable Economic Growth**  \n",
      "- **Green Jobs & Training**: Invest in renewable energy, circular economy (recycling, upcycling), and local agriculture.  \n",
      "- **Inclusive Zoning**: Reserve affordable housing units and protect against gentrification (e.g., community land trusts).  \n",
      "- **Support for Informal Sectors**: Integrate street vendors and gig workers into formal urban plans.  \n",
      "\n",
      "### **5. Smart & Low-Carbon Mobility**  \n",
      "- **Prioritize Public Transit**: Electric buses, bike lanes, and pedestrian-friendly streets.  \n",
      "- **Shared Mobility**: Promote carpooling, e-scooters, and autonomous shuttles to reduce private car ownership.  \n",
      "- **Freight Electrification**: Transition delivery fleets to EVs and optimize logistics with AI.  \n",
      "\n",
      "### **6. Circular Economy & Resource Efficiency**  \n",
      "- **Zero-Waste Systems**: Incentivize composting, recycling, and industrial symbiosis (waste = resource).  \n",
      "- **Water Reuse**: Implement greywater recycling and rainwater harvesting.  \n",
      "- **Sustainable Materials**: Use low-carbon concrete, recycled steel, and modular construction.  \n",
      "\n",
      "### **7. Technology for Sustainability & Equity**  \n",
      "- **Digital Twins**: Model urban systems (energy, traffic) to optimize planning.  \n",
      "- **IoT Sensors**: Monitor air quality, water use, and energy consumption in real time.  \n",
      "- **AI for Equity**: Use data to identify underserved areas (e.g., food deserts, transit gaps).  \n",
      "\n",
      "### **8. Governance & Policy Innovation**  \n",
      "- **Carbon Pricing & Green Bonds**: Fund sustainability projects via taxes on emissions/pollution.  \n",
      "- **Inclusive Policies**: Mandate social impact assessments for new developments.  \n",
      "- **Regional Collaboration**: Coordinate with neighboring cities on shared resources (water, energy grids).  \n",
      "\n",
      "### **9. Monitoring & Adaptive Management**  \n",
      "- **KPIs for Success**: Track metrics like GHG reductions, air quality, job creation, and affordability.  \n",
      "- **Iterative Feedback**: Use citizen science and digital dashboards to refine strategies.  \n",
      "\n",
      "### **Example: Copenhagen’s 2025 Carbon Neutral Plan**  \n",
      "- **Biking Infrastructure**: 50% commute by bike.  \n",
      "- **District Heating**: 98% from renewables.  \n",
      "- **Climate Adaptation**: Parks double as flood basins.  \n",
      "\n",
      "### **Key Trade-offs to Manage**  \n",
      "- **Density vs. Green Space**: High density reduces sprawl but requires careful green integration.  \n",
      "- **Tech vs. Privacy**: Smart cities must protect data rights.  \n",
      "- **Growth vs. Equity**: Ensure economic expansion doesn’t displace vulnerable groups.  \n",
      "\n",
      "By integrating these strategies, cities can become **prosperous, fair, and regenerative**—future-proofing against climate risks while improving quality of life. Would you like a deeper dive into any specific aspect?\n",
      "Competitor: llama-3.3-70b-versatile\n",
      "\n",
      "Designing a sustainable urban environment requires a holistic approach that balances economic growth, social equity, and environmental conservation while considering the impact of climate change and technological advancements. Here's a comprehensive approach to achieve this balance:\n",
      "\n",
      "**I. Climate-Resilient Urban Planning**\n",
      "\n",
      "1. **Green Infrastructure**: Incorporate green spaces, parks, and green roofs to mitigate urban heat islands, manage stormwater runoff, and improve air quality.\n",
      "2. **Climate-Resilient Design**: Design buildings and infrastructure to withstand extreme weather events, such as sea-level rise, flooding, and droughts.\n",
      "3. **Adaptive Urban Planning**: Develop flexible and adaptable urban plans that can respond to changing climate conditions and emerging technologies.\n",
      "\n",
      "**II. Sustainable Transportation Systems**\n",
      "\n",
      "1. **Electrification of Transportation**: Promote the adoption of electric vehicles, public transportation, and non-motorized transportation options, such as walking and cycling.\n",
      "2. **Smart Traffic Management**: Implement intelligent transportation systems that optimize traffic flow, reduce congestion, and minimize emissions.\n",
      "3. **Multimodal Transportation**: Encourage the use of multiple transportation modes, including public transportation, walking, and cycling, to reduce reliance on personal vehicles.\n",
      "\n",
      "**III. Energy-Efficient and Renewable Energy Systems**\n",
      "\n",
      "1. **Renewable Energy Integration**: Incorporate renewable energy sources, such as solar, wind, and geothermal, into the urban energy mix.\n",
      "2. **Energy-Efficient Buildings**: Design buildings with energy-efficient systems, materials, and technologies to reduce energy consumption.\n",
      "3. **Smart Grids**: Implement advanced grid management systems that optimize energy distribution, reduce energy losses, and promote energy efficiency.\n",
      "\n",
      "**IV. Water Conservation and Management**\n",
      "\n",
      "1. **Water-Efficient Systems**: Implement water-efficient technologies, such as low-flow appliances and graywater reuse systems.\n",
      "2. **Rainwater Harvesting**: Collect and store rainwater for non-potable uses, such as irrigation and toilet flushing.\n",
      "3. **Flood-Resilient Design**: Design urban infrastructure to withstand flooding, including green infrastructure, flood-resistant construction, and smart stormwater management systems.\n",
      "\n",
      "**V. Waste Reduction and Management**\n",
      "\n",
      "1. **Zero-Waste Policies**: Implement policies and programs to reduce, reuse, and recycle waste, aiming for zero waste to landfill.\n",
      "2. **Circular Economy**: Foster a circular economy by promoting the sharing, leasing, and reuse of products and materials.\n",
      "3. **Waste-to-Energy**: Consider waste-to-energy technologies, such as anaerobic digestion or gasification, to generate energy from waste.\n",
      "\n",
      "**VI. Social Equity and Inclusion**\n",
      "\n",
      "1. **Affordable Housing**: Ensure that a proportion of new housing developments are affordable and accessible to low-income residents.\n",
      "2. **Inclusive Public Spaces**: Design public spaces that are accessible, safe, and welcoming to all members of the community.\n",
      "3. **Community Engagement**: Engage with local communities in the planning and decision-making process to ensure that their needs and concerns are addressed.\n",
      "\n",
      "**VII. Technological Advancements**\n",
      "\n",
      "1. **Smart City Technologies**: Leverage technologies, such as IoT sensors, data analytics, and artificial intelligence, to optimize urban systems and services.\n",
      "2. **Digital Infrastructure**: Invest in digital infrastructure, such as high-speed internet and data storage, to support innovation and entrepreneurship.\n",
      "3. **Emerging Technologies**: Explore the potential of emerging technologies, such as autonomous vehicles, drone delivery, and urban agriculture, to enhance urban sustainability and resilience.\n",
      "\n",
      "**VIII. Economic Growth and Development**\n",
      "\n",
      "1. **Green Economy**: Foster a green economy by promoting sustainable industries, such as renewable energy, sustainable manufacturing, and eco-tourism.\n",
      "2. **Innovation Hubs**: Create innovation hubs and incubators to support start-ups and entrepreneurs working on sustainable solutions.\n",
      "3. **Public-Private Partnerships**: Collaborate with private sector partners to finance and deliver sustainable infrastructure and services.\n",
      "\n",
      "By adopting this comprehensive approach, cities can create a sustainable urban environment that balances economic growth, social equity, and environmental conservation while addressing the challenges of climate change and technological advancements.\n"
     ]
    }
   ],
   "source": [
    "# It's nice to know how to use \"zip\"\n",
    "for competitor, answer in zip(competitors, answers):\n",
    "    print(f\"Competitor: {competitor}\\n\\n{answer}\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Let's bring this together - note the use of \"enumerate\"\n",
    "\n",
    "together = \"\"\n",
    "for index, answer in enumerate(answers):\n",
    "    together += f\"# Response from competitor {index+1}\\n\\n\"\n",
    "    together += answer + \"\\n\\n\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "# Response from competitor 1\n",
      "\n",
      "Designing a sustainable urban environment that balances economic growth, social equity, and environmental conservation requires a multifaceted approach. Here are key strategies to consider:\n",
      "\n",
      "### 1. **Integrated Planning Framework**:\n",
      "   - **Holistic Vision**: Develop a comprehensive plan that incorporates long-term goals across economic, social, and environmental dimensions. Utilize systems thinking to understand interdependencies.\n",
      "   - **Stakeholder Engagement**: Involve a diverse group of stakeholders, including citizens, businesses, government agencies, and NGOs, in the planning process to ensure that multiple perspectives are considered.\n",
      "\n",
      "### 2. **Economic Growth**:\n",
      "   - **Sustainable Businesses**: Encourage the establishment of businesses that prioritize sustainability, such as green technologies and local food systems, providing incentives for startups and innovations in renewable energy.\n",
      "   - **Green Jobs**: Invest in job training programs that focus on green technology and sustainable practices to create pathways for employment that contribute to the economy while benefiting the environment.\n",
      "   - **Circular Economy**: Promote a circular economy that minimizes waste and encourages the reuse and recycling of materials.\n",
      "\n",
      "### 3. **Social Equity**:\n",
      "   - **Affordable Housing**: Implement policies that ensure access to affordable, high-quality housing for all residents, prioritizing mixed-income developments.\n",
      "   - **Inclusive Transportation**: Develop public transportation systems that are accessible and affordable, with a focus on reducing reliance on personal vehicles to enhance mobility for all demographic groups.\n",
      "   - **Community Facilities**: Invest in public spaces, parks, and community centers that foster social interaction, well-being, and provide services for all residents, paying particular attention to underrepresented communities.\n",
      "\n",
      "### 4. **Environmental Conservation**:\n",
      "   - **Green Infrastructure**: Incorporate green roofs, urban forests, and permeable surfaces to manage stormwater, reduce urban heat islands, and promote biodiversity.\n",
      "   - **Renewable Energy**: Transition to renewable energy sources, such as solar and wind, and encourage decentralized energy systems that allow communities to manage their energy needs.\n",
      "   - **Sustainable Land Use**: Utilize zoning laws that promote compact, mixed-use developments to limit urban sprawl and protect surrounding natural areas.\n",
      "\n",
      "### 5. **Climate Change Mitigation and Adaptation**:\n",
      "   - **Resilient Infrastructure**: Design infrastructure with resilience in mind, using materials and techniques that withstand climate impacts, such as flooding and extreme temperatures.\n",
      "   - **Climate Action Plans**: Develop and enforce local climate action plans that set emissions reduction targets, promote renewable energy use, and enhance disaster preparedness strategies.\n",
      "   - **Ecosystem Services**: Protect and restore local ecosystems to provide natural solutions to climate change impacts, such as wetlands for flood control and urban trees for air quality improvement.\n",
      "\n",
      "### 6. **Leveraging Technological Advancements**:\n",
      "   - **Smart Cities**: Integrate smart technologies to enhance urban service delivery, efficiency, and sustainability (e.g., smart grids, efficient waste management systems).\n",
      "   - **Data-Driven Decision Making**: Utilize data analytics to monitor environmental impacts, social needs, and economic performance, allowing for agile responses to challenges.\n",
      "   - **Public Engagement Platforms**: Create digital platforms that allow residents to engage in urban planning and communicate their needs and ideas effectively.\n",
      "\n",
      "### 7. **Education and Awareness**:\n",
      "   - **Community Education Programs**: Establish programs that educate citizens about sustainability, resilience, and the importance of social equity in creating a cohesive urban environment.\n",
      "   - **Collaborations with Educational Institutions**: Partner with schools and universities to conduct research, projects, and internships focused on sustainability and urban challenges.\n",
      "\n",
      "### Conclusion\n",
      "The success of a sustainable urban environment hinges on continuous evaluation and adaptation of strategies in response to emerging challenges and opportunities. By fostering collaboration among stakeholders and leveraging technological advancements, cities can build resilient urban landscapes that thrive economically while ensuring social equity and environmental health. Implementing these strategies holistically will create vibrant communities that are prepared for the future.\n",
      "\n",
      "# Response from competitor 2\n",
      "\n",
      "# Designing a Sustainable Urban Environment\n",
      "\n",
      "My approach would integrate multiple dimensions of sustainability through these key strategies:\n",
      "\n",
      "## Foundational Planning Principles\n",
      "- Implement **mixed-use zoning** to reduce commute distances and create vibrant neighborhoods\n",
      "- Adopt **circular economy models** where waste becomes a resource\n",
      "- Design for **climate resilience** with infrastructure that anticipates extreme weather events\n",
      "- Use **systems thinking** to understand how transportation, housing, energy, and social systems interact\n",
      "\n",
      "## Environmental Strategies\n",
      "- Develop **green infrastructure networks** (urban forests, bioswales, green roofs)\n",
      "- Transition to **renewable energy** with district systems and microgrids\n",
      "- Prioritize **water-sensitive urban design** for conservation and flood management\n",
      "- Create **biodiversity corridors** connecting urban green spaces\n",
      "\n",
      "## Social Equity Considerations\n",
      "- Ensure **affordable housing** across all neighborhoods through inclusionary zoning\n",
      "- Design **accessible public spaces** that accommodate diverse needs and ages\n",
      "- Implement **participatory planning processes** centering marginalized communities\n",
      "- Distribute **environmental amenities equitably** to prevent \"green gentrification\"\n",
      "\n",
      "## Economic Framework\n",
      "- Support **local businesses and circular economies** through procurement policies\n",
      "- Invest in **green jobs training** for marginalized communities\n",
      "- Create **innovation districts** for sustainable technology development\n",
      "- Use **progressive taxation** to fund public infrastructure and services\n",
      "\n",
      "## Technology Integration\n",
      "- Deploy **smart city infrastructure** that respects privacy and reduces consumption\n",
      "- Implement **digital inclusion programs** to ensure equitable technology access\n",
      "- Use **data analytics** to optimize resource use and service delivery\n",
      "\n",
      "Success would ultimately depend on collaborative governance involving diverse stakeholders and continuous adaptation as conditions evolve.\n",
      "\n",
      "# Response from competitor 3\n",
      "\n",
      "Designing a sustainable urban environment that truly balances economic growth, social equity, and environmental conservation, while also factoring in climate change and technological advancements, requires a holistic, integrated, and adaptive approach. It's not a static blueprint but a dynamic framework for continuous evolution.\n",
      "\n",
      "Here's a comprehensive approach:\n",
      "\n",
      "---\n",
      "\n",
      "## **A Holistic Approach to Sustainable Urban Design**\n",
      "\n",
      "The core principle is **systems thinking**, recognizing that all elements of the city are interconnected. Changes in one area will inevitably impact others.\n",
      "\n",
      "### **Phase 1: Visioning, Assessment & Stakeholder Engagement**\n",
      "\n",
      "1.  **Comprehensive Baseline Assessment:**\n",
      "    *   **Environmental:** Current emissions, air/water quality, biodiversity, resource consumption (energy, water, waste), vulnerability to climate hazards (flooding, heatwaves, sea-level rise).\n",
      "    *   **Economic:** Key industries, employment rates, income distribution, existing infrastructure, innovation capacity.\n",
      "    *   **Social:** Demographics, housing affordability, access to services (education, healthcare, transport), green spaces, public safety, social cohesion, digital literacy.\n",
      "    *   **Technological:** Existing infrastructure, digital divide, local innovation ecosystem.\n",
      "\n",
      "2.  **Inclusive Stakeholder Engagement:**\n",
      "    *   **Government:** All levels (municipal, regional, national).\n",
      "    *   **Private Sector:** Businesses, industries, developers, tech companies.\n",
      "    *   **Academia & Research:** Universities, think tanks for data, innovation, and expertise.\n",
      "    *   **Civil Society:** NGOs, community groups, residents (especially marginalized communities), youth.\n",
      "    *   **Purpose:** Co-create a shared vision, identify priorities, gather diverse perspectives, build consensus, and foster ownership. This is crucial for ensuring social equity is embedded from the start.\n",
      "\n",
      "3.  **Define Goals & Key Performance Indicators (KPIs):**\n",
      "    *   Establish measurable, time-bound targets for all three pillars (e.g., X% reduction in emissions by 20XX, X% affordable housing, Y% green space per capita, Z% local job creation).\n",
      "    *   Include climate resilience metrics (e.g., reduced flood risk, increased permeable surfaces).\n",
      "\n",
      "### **Phase 2: Integrated Design & Planning Principles**\n",
      "\n",
      "This phase translates the vision into actionable plans, emphasizing cross-sectoral integration.\n",
      "\n",
      "1.  **Eco-Centric Infrastructure & Urban Planning:**\n",
      "    *   **Energy:** Transition to 100% renewable energy sources (solar, wind, geothermal). Implement smart grids, demand-side management, energy efficiency standards for buildings, and district heating/cooling. Promote decentralized energy generation.\n",
      "    *   **Water:** Implement integrated water management (IWM) – closed-loop systems, rainwater harvesting, greywater recycling, wastewater treatment for reuse, permeable surfaces to reduce runoff and replenish groundwater. Protect natural water bodies.\n",
      "    *   **Waste:** Move towards a circular economy model. Drastically reduce waste generation, maximize reuse and recycling, promote composting, and explore waste-to-energy where appropriate (as a last resort after reduction/reuse).\n",
      "    *   **Green & Blue Infrastructure:** Prioritize green spaces (parks, urban forests, vertical gardens) and blue spaces (rivers, canals, ponds) for biodiversity, air purification, urban cooling (combating heat islands), stormwater management, and public well-being. Create ecological corridors.\n",
      "    *   **Sustainable Mobility:** Design for transit-oriented development (TOD). Prioritize walking, cycling, and robust, efficient, and accessible public transport (electric buses/trams, high-speed rail connections). Discourage private car use through infrastructure and policy (e.g., congestion pricing). Promote shared mobility services (bikes, EVs).\n",
      "    *   **Sustainable Buildings:** Mandate high standards for energy efficiency, passive design, use of local and recycled materials, green roofs/walls, and water conservation in all new and renovated buildings.\n",
      "\n",
      "2.  **Economic Growth through Sustainability:**\n",
      "    *   **Green Economy Development:** Foster industries related to renewable energy, sustainable manufacturing, ecological restoration, green technology, and circular economy solutions. This creates new jobs and economic diversification.\n",
      "    *   **Local & Resilient Supply Chains:** Support local businesses, urban agriculture, and short supply chains to reduce transport emissions, build community wealth, and enhance resilience to external shocks.\n",
      "    *   **Innovation Hubs:** Create dedicated zones for R&D in green tech, smart city solutions, and sustainable materials, fostering collaboration between academia, startups, and established companies.\n",
      "    *   **Resource Efficiency as Economic Driver:** Demonstrate how reducing energy, water, and waste consumption leads to significant cost savings for businesses and residents, making the city more competitive and attractive for investment.\n",
      "\n",
      "3.  **Social Equity at the Core:**\n",
      "    *   **Affordable & Inclusive Housing:** Implement policies for mixed-income developments, inclusionary zoning, and social housing initiatives to prevent gentrification and ensure housing access for all income levels. Design diverse housing types.\n",
      "    *   **Equitable Access to Services:** Ensure all residents have easy access to quality education, healthcare, public transport, green spaces, cultural facilities, and healthy food options, regardless of income or neighborhood.\n",
      "    *   **Participatory Governance:** Establish ongoing mechanisms for citizen engagement in planning, decision-making, and oversight. Empower local communities.\n",
      "    *   **Digital Inclusion:** Bridge the digital divide by ensuring universal access to affordable high-speed internet and digital literacy programs, enabling participation in the smart city and access to services.\n",
      "    *   **Health & Wellbeing:** Design for walkable neighborhoods, safe public spaces, clean air, and access to nature to promote physical and mental health. Address noise pollution.\n",
      "\n",
      "4.  **Climate Change Mitigation & Adaptation:**\n",
      "    *   **Mitigation:** Directly addressed by the environmental conservation strategies (renewable energy, sustainable transport, waste reduction). Set ambitious carbon neutrality targets.\n",
      "    *   **Adaptation & Resilience:**\n",
      "        *   **Infrastructure:** Design climate-resilient infrastructure (e.g., elevated roads in flood zones, heat-resistant materials, decentralized energy for grid resilience).\n",
      "        *   **Nature-Based Solutions:** Utilize green and blue infrastructure for flood protection, heat island mitigation (e.g., street trees, permeable pavements), and shoreline protection.\n",
      "        *   **Early Warning Systems:** Implement advanced sensor networks and data analytics for real-time monitoring of weather patterns, air quality, and potential hazards, providing timely alerts to residents.\n",
      "        *   **Emergency Preparedness:** Develop robust disaster response plans and community-level resilience programs.\n",
      "        *   **Water Security:** Plan for drought resilience through diversified water sources and efficient use.\n",
      "\n",
      "5.  **Leveraging Technological Advancements:**\n",
      "    *   **Smart City Technologies:** Utilize IoT sensors, AI, and big data analytics for:\n",
      "        *   **Resource Management:** Optimize energy use (smart grids), water distribution, and waste collection.\n",
      "        *   **Traffic Management:** Reduce congestion and emissions.\n",
      "        *   **Environmental Monitoring:** Real-time air/water quality, noise levels, heat maps.\n",
      "        *   **Public Safety:** Enhanced security and emergency response.\n",
      "    *   **Digital Platforms for Citizen Engagement:** Develop accessible online platforms for participatory planning, feedback, and service delivery.\n",
      "    *   **Advanced Materials:** Research and implement sustainable, durable, and low-carbon building materials (e.g., self-healing concrete, bio-based materials).\n",
      "    *   **Autonomous Vehicles/Drones:** Explore their potential for optimized public transport, last-mile delivery, and infrastructure inspection (while managing potential social/environmental impacts).\n",
      "    *   **Digital Twin Technology:** Create virtual models of the city to simulate different scenarios (e.g., flood impacts, traffic flow, energy consumption) and test design interventions before implementation.\n",
      "\n",
      "### **Phase 3: Governance, Policies & Implementation**\n",
      "\n",
      "1.  **Integrated Governance Model:** Establish a cross-departmental task force or agency responsible for overseeing sustainable urban development, breaking down traditional silos.\n",
      "2.  **Policy & Regulatory Framework:**\n",
      "    *   Incentivize sustainable practices (tax breaks for green buildings, subsidies for renewables).\n",
      "    *   Mandate environmental performance standards.\n",
      "    *   Implement carbon pricing or emissions trading schemes.\n",
      "    *   Streamline permitting for sustainable projects.\n",
      "    *   Robust zoning laws that encourage mixed-use development and protect green spaces.\n",
      "3.  **Financing & Investment:**\n",
      "    *   Attract green finance, impact investors, and public-private partnerships.\n",
      "    *   Explore municipal green bonds.\n",
      "    *   Leverage national and international climate funds.\n",
      "4.  **Pilot Projects & Scalability:** Start with small, manageable pilot projects to test concepts, gather data, and demonstrate success before scaling up.\n",
      "5.  **Education & Capacity Building:** Invest in training for urban planners, engineers, policymakers, and the public on sustainable practices and climate change.\n",
      "\n",
      "### **Phase 4: Monitoring, Evaluation & Adaptive Management**\n",
      "\n",
      "1.  **Continuous Monitoring:** Regularly track progress against established KPIs using data from sensors, citizen feedback, and traditional surveys.\n",
      "2.  **Regular Review & Evaluation:** Conduct periodic reviews to assess the effectiveness of policies and interventions.\n",
      "3.  **Adaptive Management:** Be prepared to adjust strategies and plans based on monitoring data, emerging technologies, unforeseen challenges, and evolving community needs. This is critical for long-term resilience and flexibility in the face of rapid change.\n",
      "4.  **Transparency & Reporting:** Publish regular reports on the city's sustainability performance, fostering accountability and public trust.\n",
      "\n",
      "---\n",
      "\n",
      "**Challenges & Balancing Act:**\n",
      "\n",
      "The biggest challenge is often the **trade-offs**. For example:\n",
      "*   Economic growth often historically came at an environmental cost. The design must demonstrate how green economy can *drive* growth.\n",
      "*   New infrastructure might displace communities; social equity demands robust resettlement plans and community benefit agreements.\n",
      "*   Technological advancements raise privacy concerns; robust data governance and ethical AI principles are crucial.\n",
      "\n",
      "The \"balancing act\" is achieved not by compromising on each pillar, but by finding **synergies** where they reinforce each other. A healthy environment supports a productive economy and human well-being. A vibrant economy can fund sustainable infrastructure and social programs. Social equity ensures that the benefits of sustainability are shared by all, fostering a more resilient and cohesive community capable of adapting to future challenges.\n",
      "\n",
      "# Response from competitor 4\n",
      "\n",
      "Designing a sustainable urban environment that balances economic growth, social equity, and environmental conservation—while addressing climate change and leveraging technology—requires a holistic, systems-thinking approach. Here’s a step-by-step framework:\n",
      "\n",
      "### **1. Vision and Stakeholder Engagement**  \n",
      "- **Define Shared Goals**: Establish a clear vision integrating sustainability, equity, and resilience (e.g., carbon neutrality by 2050, zero displacement, green job creation).  \n",
      "- **Participatory Planning**: Engage communities, businesses, NGOs, and policymakers to ensure diverse needs are met (e.g., co-design workshops, digital platforms for feedback).  \n",
      "\n",
      "### **2. Compact, Mixed-Use Urban Design**  \n",
      "- **Transit-Oriented Development (TOD)**: Prioritize dense, walkable neighborhoods with mixed-income housing near public transit to reduce car dependency.  \n",
      "- **15-Minute City Concept**: Ensure access to jobs, schools, healthcare, and recreation within short distances.  \n",
      "- **Green Infrastructure**: Integrate parks, urban forests, and green roofs to mitigate heat islands and manage stormwater.  \n",
      "\n",
      "### **3. Climate-Resilient Infrastructure**  \n",
      "- **Adaptive Buildings**: Mandate net-zero energy designs, passive cooling, and flood-resistant materials.  \n",
      "- **Renewable Energy Microgrids**: Decentralize energy with solar/wind + battery storage to enhance resilience.  \n",
      "- **Blue-Green Systems**: Use permeable pavements, bioswales, and restored wetlands to combat flooding.  \n",
      "\n",
      "### **4. Equitable Economic Growth**  \n",
      "- **Green Jobs & Training**: Invest in renewable energy, circular economy (recycling, upcycling), and local agriculture.  \n",
      "- **Inclusive Zoning**: Reserve affordable housing units and protect against gentrification (e.g., community land trusts).  \n",
      "- **Support for Informal Sectors**: Integrate street vendors and gig workers into formal urban plans.  \n",
      "\n",
      "### **5. Smart & Low-Carbon Mobility**  \n",
      "- **Prioritize Public Transit**: Electric buses, bike lanes, and pedestrian-friendly streets.  \n",
      "- **Shared Mobility**: Promote carpooling, e-scooters, and autonomous shuttles to reduce private car ownership.  \n",
      "- **Freight Electrification**: Transition delivery fleets to EVs and optimize logistics with AI.  \n",
      "\n",
      "### **6. Circular Economy & Resource Efficiency**  \n",
      "- **Zero-Waste Systems**: Incentivize composting, recycling, and industrial symbiosis (waste = resource).  \n",
      "- **Water Reuse**: Implement greywater recycling and rainwater harvesting.  \n",
      "- **Sustainable Materials**: Use low-carbon concrete, recycled steel, and modular construction.  \n",
      "\n",
      "### **7. Technology for Sustainability & Equity**  \n",
      "- **Digital Twins**: Model urban systems (energy, traffic) to optimize planning.  \n",
      "- **IoT Sensors**: Monitor air quality, water use, and energy consumption in real time.  \n",
      "- **AI for Equity**: Use data to identify underserved areas (e.g., food deserts, transit gaps).  \n",
      "\n",
      "### **8. Governance & Policy Innovation**  \n",
      "- **Carbon Pricing & Green Bonds**: Fund sustainability projects via taxes on emissions/pollution.  \n",
      "- **Inclusive Policies**: Mandate social impact assessments for new developments.  \n",
      "- **Regional Collaboration**: Coordinate with neighboring cities on shared resources (water, energy grids).  \n",
      "\n",
      "### **9. Monitoring & Adaptive Management**  \n",
      "- **KPIs for Success**: Track metrics like GHG reductions, air quality, job creation, and affordability.  \n",
      "- **Iterative Feedback**: Use citizen science and digital dashboards to refine strategies.  \n",
      "\n",
      "### **Example: Copenhagen’s 2025 Carbon Neutral Plan**  \n",
      "- **Biking Infrastructure**: 50% commute by bike.  \n",
      "- **District Heating**: 98% from renewables.  \n",
      "- **Climate Adaptation**: Parks double as flood basins.  \n",
      "\n",
      "### **Key Trade-offs to Manage**  \n",
      "- **Density vs. Green Space**: High density reduces sprawl but requires careful green integration.  \n",
      "- **Tech vs. Privacy**: Smart cities must protect data rights.  \n",
      "- **Growth vs. Equity**: Ensure economic expansion doesn’t displace vulnerable groups.  \n",
      "\n",
      "By integrating these strategies, cities can become **prosperous, fair, and regenerative**—future-proofing against climate risks while improving quality of life. Would you like a deeper dive into any specific aspect?\n",
      "\n",
      "# Response from competitor 5\n",
      "\n",
      "Designing a sustainable urban environment requires a holistic approach that balances economic growth, social equity, and environmental conservation while considering the impact of climate change and technological advancements. Here's a comprehensive approach to achieve this balance:\n",
      "\n",
      "**I. Climate-Resilient Urban Planning**\n",
      "\n",
      "1. **Green Infrastructure**: Incorporate green spaces, parks, and green roofs to mitigate urban heat islands, manage stormwater runoff, and improve air quality.\n",
      "2. **Climate-Resilient Design**: Design buildings and infrastructure to withstand extreme weather events, such as sea-level rise, flooding, and droughts.\n",
      "3. **Adaptive Urban Planning**: Develop flexible and adaptable urban plans that can respond to changing climate conditions and emerging technologies.\n",
      "\n",
      "**II. Sustainable Transportation Systems**\n",
      "\n",
      "1. **Electrification of Transportation**: Promote the adoption of electric vehicles, public transportation, and non-motorized transportation options, such as walking and cycling.\n",
      "2. **Smart Traffic Management**: Implement intelligent transportation systems that optimize traffic flow, reduce congestion, and minimize emissions.\n",
      "3. **Multimodal Transportation**: Encourage the use of multiple transportation modes, including public transportation, walking, and cycling, to reduce reliance on personal vehicles.\n",
      "\n",
      "**III. Energy-Efficient and Renewable Energy Systems**\n",
      "\n",
      "1. **Renewable Energy Integration**: Incorporate renewable energy sources, such as solar, wind, and geothermal, into the urban energy mix.\n",
      "2. **Energy-Efficient Buildings**: Design buildings with energy-efficient systems, materials, and technologies to reduce energy consumption.\n",
      "3. **Smart Grids**: Implement advanced grid management systems that optimize energy distribution, reduce energy losses, and promote energy efficiency.\n",
      "\n",
      "**IV. Water Conservation and Management**\n",
      "\n",
      "1. **Water-Efficient Systems**: Implement water-efficient technologies, such as low-flow appliances and graywater reuse systems.\n",
      "2. **Rainwater Harvesting**: Collect and store rainwater for non-potable uses, such as irrigation and toilet flushing.\n",
      "3. **Flood-Resilient Design**: Design urban infrastructure to withstand flooding, including green infrastructure, flood-resistant construction, and smart stormwater management systems.\n",
      "\n",
      "**V. Waste Reduction and Management**\n",
      "\n",
      "1. **Zero-Waste Policies**: Implement policies and programs to reduce, reuse, and recycle waste, aiming for zero waste to landfill.\n",
      "2. **Circular Economy**: Foster a circular economy by promoting the sharing, leasing, and reuse of products and materials.\n",
      "3. **Waste-to-Energy**: Consider waste-to-energy technologies, such as anaerobic digestion or gasification, to generate energy from waste.\n",
      "\n",
      "**VI. Social Equity and Inclusion**\n",
      "\n",
      "1. **Affordable Housing**: Ensure that a proportion of new housing developments are affordable and accessible to low-income residents.\n",
      "2. **Inclusive Public Spaces**: Design public spaces that are accessible, safe, and welcoming to all members of the community.\n",
      "3. **Community Engagement**: Engage with local communities in the planning and decision-making process to ensure that their needs and concerns are addressed.\n",
      "\n",
      "**VII. Technological Advancements**\n",
      "\n",
      "1. **Smart City Technologies**: Leverage technologies, such as IoT sensors, data analytics, and artificial intelligence, to optimize urban systems and services.\n",
      "2. **Digital Infrastructure**: Invest in digital infrastructure, such as high-speed internet and data storage, to support innovation and entrepreneurship.\n",
      "3. **Emerging Technologies**: Explore the potential of emerging technologies, such as autonomous vehicles, drone delivery, and urban agriculture, to enhance urban sustainability and resilience.\n",
      "\n",
      "**VIII. Economic Growth and Development**\n",
      "\n",
      "1. **Green Economy**: Foster a green economy by promoting sustainable industries, such as renewable energy, sustainable manufacturing, and eco-tourism.\n",
      "2. **Innovation Hubs**: Create innovation hubs and incubators to support start-ups and entrepreneurs working on sustainable solutions.\n",
      "3. **Public-Private Partnerships**: Collaborate with private sector partners to finance and deliver sustainable infrastructure and services.\n",
      "\n",
      "By adopting this comprehensive approach, cities can create a sustainable urban environment that balances economic growth, social equity, and environmental conservation while addressing the challenges of climate change and technological advancements.\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(together)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "judge = f\"\"\"You are judging a competition between {len(competitors)} competitors.\n",
    "Each model has been given this question:\n",
    "\n",
    "{question}\n",
    "\n",
    "Your job is to evaluate each response for clarity and strength of argument, and rank them in order of best to worst.\n",
    "Respond with JSON, and only JSON, with the following format:\n",
    "{{\"results\": [\"best competitor number\", \"second best competitor number\", \"third best competitor number\", ...]}}\n",
    "\n",
    "Here are the responses from each competitor:\n",
    "\n",
    "{together}\n",
    "\n",
    "Now respond with the JSON with the ranked order of the competitors, nothing else. Do not include markdown formatting or code blocks.\"\"\"\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You are judging a competition between 5 competitors.\n",
      "Each model has been given this question:\n",
      "\n",
      "How would you approach designing a sustainable urban environment that balances economic growth, social equity, and environmental conservation, while also considering the impact of climate change and technological advancements?\n",
      "\n",
      "Your job is to evaluate each response for clarity and strength of argument, and rank them in order of best to worst.\n",
      "Respond with JSON, and only JSON, with the following format:\n",
      "{\"results\": [\"best competitor number\", \"second best competitor number\", \"third best competitor number\", ...]}\n",
      "\n",
      "Here are the responses from each competitor:\n",
      "\n",
      "# Response from competitor 1\n",
      "\n",
      "Designing a sustainable urban environment that balances economic growth, social equity, and environmental conservation requires a multifaceted approach. Here are key strategies to consider:\n",
      "\n",
      "### 1. **Integrated Planning Framework**:\n",
      "   - **Holistic Vision**: Develop a comprehensive plan that incorporates long-term goals across economic, social, and environmental dimensions. Utilize systems thinking to understand interdependencies.\n",
      "   - **Stakeholder Engagement**: Involve a diverse group of stakeholders, including citizens, businesses, government agencies, and NGOs, in the planning process to ensure that multiple perspectives are considered.\n",
      "\n",
      "### 2. **Economic Growth**:\n",
      "   - **Sustainable Businesses**: Encourage the establishment of businesses that prioritize sustainability, such as green technologies and local food systems, providing incentives for startups and innovations in renewable energy.\n",
      "   - **Green Jobs**: Invest in job training programs that focus on green technology and sustainable practices to create pathways for employment that contribute to the economy while benefiting the environment.\n",
      "   - **Circular Economy**: Promote a circular economy that minimizes waste and encourages the reuse and recycling of materials.\n",
      "\n",
      "### 3. **Social Equity**:\n",
      "   - **Affordable Housing**: Implement policies that ensure access to affordable, high-quality housing for all residents, prioritizing mixed-income developments.\n",
      "   - **Inclusive Transportation**: Develop public transportation systems that are accessible and affordable, with a focus on reducing reliance on personal vehicles to enhance mobility for all demographic groups.\n",
      "   - **Community Facilities**: Invest in public spaces, parks, and community centers that foster social interaction, well-being, and provide services for all residents, paying particular attention to underrepresented communities.\n",
      "\n",
      "### 4. **Environmental Conservation**:\n",
      "   - **Green Infrastructure**: Incorporate green roofs, urban forests, and permeable surfaces to manage stormwater, reduce urban heat islands, and promote biodiversity.\n",
      "   - **Renewable Energy**: Transition to renewable energy sources, such as solar and wind, and encourage decentralized energy systems that allow communities to manage their energy needs.\n",
      "   - **Sustainable Land Use**: Utilize zoning laws that promote compact, mixed-use developments to limit urban sprawl and protect surrounding natural areas.\n",
      "\n",
      "### 5. **Climate Change Mitigation and Adaptation**:\n",
      "   - **Resilient Infrastructure**: Design infrastructure with resilience in mind, using materials and techniques that withstand climate impacts, such as flooding and extreme temperatures.\n",
      "   - **Climate Action Plans**: Develop and enforce local climate action plans that set emissions reduction targets, promote renewable energy use, and enhance disaster preparedness strategies.\n",
      "   - **Ecosystem Services**: Protect and restore local ecosystems to provide natural solutions to climate change impacts, such as wetlands for flood control and urban trees for air quality improvement.\n",
      "\n",
      "### 6. **Leveraging Technological Advancements**:\n",
      "   - **Smart Cities**: Integrate smart technologies to enhance urban service delivery, efficiency, and sustainability (e.g., smart grids, efficient waste management systems).\n",
      "   - **Data-Driven Decision Making**: Utilize data analytics to monitor environmental impacts, social needs, and economic performance, allowing for agile responses to challenges.\n",
      "   - **Public Engagement Platforms**: Create digital platforms that allow residents to engage in urban planning and communicate their needs and ideas effectively.\n",
      "\n",
      "### 7. **Education and Awareness**:\n",
      "   - **Community Education Programs**: Establish programs that educate citizens about sustainability, resilience, and the importance of social equity in creating a cohesive urban environment.\n",
      "   - **Collaborations with Educational Institutions**: Partner with schools and universities to conduct research, projects, and internships focused on sustainability and urban challenges.\n",
      "\n",
      "### Conclusion\n",
      "The success of a sustainable urban environment hinges on continuous evaluation and adaptation of strategies in response to emerging challenges and opportunities. By fostering collaboration among stakeholders and leveraging technological advancements, cities can build resilient urban landscapes that thrive economically while ensuring social equity and environmental health. Implementing these strategies holistically will create vibrant communities that are prepared for the future.\n",
      "\n",
      "# Response from competitor 2\n",
      "\n",
      "# Designing a Sustainable Urban Environment\n",
      "\n",
      "My approach would integrate multiple dimensions of sustainability through these key strategies:\n",
      "\n",
      "## Foundational Planning Principles\n",
      "- Implement **mixed-use zoning** to reduce commute distances and create vibrant neighborhoods\n",
      "- Adopt **circular economy models** where waste becomes a resource\n",
      "- Design for **climate resilience** with infrastructure that anticipates extreme weather events\n",
      "- Use **systems thinking** to understand how transportation, housing, energy, and social systems interact\n",
      "\n",
      "## Environmental Strategies\n",
      "- Develop **green infrastructure networks** (urban forests, bioswales, green roofs)\n",
      "- Transition to **renewable energy** with district systems and microgrids\n",
      "- Prioritize **water-sensitive urban design** for conservation and flood management\n",
      "- Create **biodiversity corridors** connecting urban green spaces\n",
      "\n",
      "## Social Equity Considerations\n",
      "- Ensure **affordable housing** across all neighborhoods through inclusionary zoning\n",
      "- Design **accessible public spaces** that accommodate diverse needs and ages\n",
      "- Implement **participatory planning processes** centering marginalized communities\n",
      "- Distribute **environmental amenities equitably** to prevent \"green gentrification\"\n",
      "\n",
      "## Economic Framework\n",
      "- Support **local businesses and circular economies** through procurement policies\n",
      "- Invest in **green jobs training** for marginalized communities\n",
      "- Create **innovation districts** for sustainable technology development\n",
      "- Use **progressive taxation** to fund public infrastructure and services\n",
      "\n",
      "## Technology Integration\n",
      "- Deploy **smart city infrastructure** that respects privacy and reduces consumption\n",
      "- Implement **digital inclusion programs** to ensure equitable technology access\n",
      "- Use **data analytics** to optimize resource use and service delivery\n",
      "\n",
      "Success would ultimately depend on collaborative governance involving diverse stakeholders and continuous adaptation as conditions evolve.\n",
      "\n",
      "# Response from competitor 3\n",
      "\n",
      "Designing a sustainable urban environment that truly balances economic growth, social equity, and environmental conservation, while also factoring in climate change and technological advancements, requires a holistic, integrated, and adaptive approach. It's not a static blueprint but a dynamic framework for continuous evolution.\n",
      "\n",
      "Here's a comprehensive approach:\n",
      "\n",
      "---\n",
      "\n",
      "## **A Holistic Approach to Sustainable Urban Design**\n",
      "\n",
      "The core principle is **systems thinking**, recognizing that all elements of the city are interconnected. Changes in one area will inevitably impact others.\n",
      "\n",
      "### **Phase 1: Visioning, Assessment & Stakeholder Engagement**\n",
      "\n",
      "1.  **Comprehensive Baseline Assessment:**\n",
      "    *   **Environmental:** Current emissions, air/water quality, biodiversity, resource consumption (energy, water, waste), vulnerability to climate hazards (flooding, heatwaves, sea-level rise).\n",
      "    *   **Economic:** Key industries, employment rates, income distribution, existing infrastructure, innovation capacity.\n",
      "    *   **Social:** Demographics, housing affordability, access to services (education, healthcare, transport), green spaces, public safety, social cohesion, digital literacy.\n",
      "    *   **Technological:** Existing infrastructure, digital divide, local innovation ecosystem.\n",
      "\n",
      "2.  **Inclusive Stakeholder Engagement:**\n",
      "    *   **Government:** All levels (municipal, regional, national).\n",
      "    *   **Private Sector:** Businesses, industries, developers, tech companies.\n",
      "    *   **Academia & Research:** Universities, think tanks for data, innovation, and expertise.\n",
      "    *   **Civil Society:** NGOs, community groups, residents (especially marginalized communities), youth.\n",
      "    *   **Purpose:** Co-create a shared vision, identify priorities, gather diverse perspectives, build consensus, and foster ownership. This is crucial for ensuring social equity is embedded from the start.\n",
      "\n",
      "3.  **Define Goals & Key Performance Indicators (KPIs):**\n",
      "    *   Establish measurable, time-bound targets for all three pillars (e.g., X% reduction in emissions by 20XX, X% affordable housing, Y% green space per capita, Z% local job creation).\n",
      "    *   Include climate resilience metrics (e.g., reduced flood risk, increased permeable surfaces).\n",
      "\n",
      "### **Phase 2: Integrated Design & Planning Principles**\n",
      "\n",
      "This phase translates the vision into actionable plans, emphasizing cross-sectoral integration.\n",
      "\n",
      "1.  **Eco-Centric Infrastructure & Urban Planning:**\n",
      "    *   **Energy:** Transition to 100% renewable energy sources (solar, wind, geothermal). Implement smart grids, demand-side management, energy efficiency standards for buildings, and district heating/cooling. Promote decentralized energy generation.\n",
      "    *   **Water:** Implement integrated water management (IWM) – closed-loop systems, rainwater harvesting, greywater recycling, wastewater treatment for reuse, permeable surfaces to reduce runoff and replenish groundwater. Protect natural water bodies.\n",
      "    *   **Waste:** Move towards a circular economy model. Drastically reduce waste generation, maximize reuse and recycling, promote composting, and explore waste-to-energy where appropriate (as a last resort after reduction/reuse).\n",
      "    *   **Green & Blue Infrastructure:** Prioritize green spaces (parks, urban forests, vertical gardens) and blue spaces (rivers, canals, ponds) for biodiversity, air purification, urban cooling (combating heat islands), stormwater management, and public well-being. Create ecological corridors.\n",
      "    *   **Sustainable Mobility:** Design for transit-oriented development (TOD). Prioritize walking, cycling, and robust, efficient, and accessible public transport (electric buses/trams, high-speed rail connections). Discourage private car use through infrastructure and policy (e.g., congestion pricing). Promote shared mobility services (bikes, EVs).\n",
      "    *   **Sustainable Buildings:** Mandate high standards for energy efficiency, passive design, use of local and recycled materials, green roofs/walls, and water conservation in all new and renovated buildings.\n",
      "\n",
      "2.  **Economic Growth through Sustainability:**\n",
      "    *   **Green Economy Development:** Foster industries related to renewable energy, sustainable manufacturing, ecological restoration, green technology, and circular economy solutions. This creates new jobs and economic diversification.\n",
      "    *   **Local & Resilient Supply Chains:** Support local businesses, urban agriculture, and short supply chains to reduce transport emissions, build community wealth, and enhance resilience to external shocks.\n",
      "    *   **Innovation Hubs:** Create dedicated zones for R&D in green tech, smart city solutions, and sustainable materials, fostering collaboration between academia, startups, and established companies.\n",
      "    *   **Resource Efficiency as Economic Driver:** Demonstrate how reducing energy, water, and waste consumption leads to significant cost savings for businesses and residents, making the city more competitive and attractive for investment.\n",
      "\n",
      "3.  **Social Equity at the Core:**\n",
      "    *   **Affordable & Inclusive Housing:** Implement policies for mixed-income developments, inclusionary zoning, and social housing initiatives to prevent gentrification and ensure housing access for all income levels. Design diverse housing types.\n",
      "    *   **Equitable Access to Services:** Ensure all residents have easy access to quality education, healthcare, public transport, green spaces, cultural facilities, and healthy food options, regardless of income or neighborhood.\n",
      "    *   **Participatory Governance:** Establish ongoing mechanisms for citizen engagement in planning, decision-making, and oversight. Empower local communities.\n",
      "    *   **Digital Inclusion:** Bridge the digital divide by ensuring universal access to affordable high-speed internet and digital literacy programs, enabling participation in the smart city and access to services.\n",
      "    *   **Health & Wellbeing:** Design for walkable neighborhoods, safe public spaces, clean air, and access to nature to promote physical and mental health. Address noise pollution.\n",
      "\n",
      "4.  **Climate Change Mitigation & Adaptation:**\n",
      "    *   **Mitigation:** Directly addressed by the environmental conservation strategies (renewable energy, sustainable transport, waste reduction). Set ambitious carbon neutrality targets.\n",
      "    *   **Adaptation & Resilience:**\n",
      "        *   **Infrastructure:** Design climate-resilient infrastructure (e.g., elevated roads in flood zones, heat-resistant materials, decentralized energy for grid resilience).\n",
      "        *   **Nature-Based Solutions:** Utilize green and blue infrastructure for flood protection, heat island mitigation (e.g., street trees, permeable pavements), and shoreline protection.\n",
      "        *   **Early Warning Systems:** Implement advanced sensor networks and data analytics for real-time monitoring of weather patterns, air quality, and potential hazards, providing timely alerts to residents.\n",
      "        *   **Emergency Preparedness:** Develop robust disaster response plans and community-level resilience programs.\n",
      "        *   **Water Security:** Plan for drought resilience through diversified water sources and efficient use.\n",
      "\n",
      "5.  **Leveraging Technological Advancements:**\n",
      "    *   **Smart City Technologies:** Utilize IoT sensors, AI, and big data analytics for:\n",
      "        *   **Resource Management:** Optimize energy use (smart grids), water distribution, and waste collection.\n",
      "        *   **Traffic Management:** Reduce congestion and emissions.\n",
      "        *   **Environmental Monitoring:** Real-time air/water quality, noise levels, heat maps.\n",
      "        *   **Public Safety:** Enhanced security and emergency response.\n",
      "    *   **Digital Platforms for Citizen Engagement:** Develop accessible online platforms for participatory planning, feedback, and service delivery.\n",
      "    *   **Advanced Materials:** Research and implement sustainable, durable, and low-carbon building materials (e.g., self-healing concrete, bio-based materials).\n",
      "    *   **Autonomous Vehicles/Drones:** Explore their potential for optimized public transport, last-mile delivery, and infrastructure inspection (while managing potential social/environmental impacts).\n",
      "    *   **Digital Twin Technology:** Create virtual models of the city to simulate different scenarios (e.g., flood impacts, traffic flow, energy consumption) and test design interventions before implementation.\n",
      "\n",
      "### **Phase 3: Governance, Policies & Implementation**\n",
      "\n",
      "1.  **Integrated Governance Model:** Establish a cross-departmental task force or agency responsible for overseeing sustainable urban development, breaking down traditional silos.\n",
      "2.  **Policy & Regulatory Framework:**\n",
      "    *   Incentivize sustainable practices (tax breaks for green buildings, subsidies for renewables).\n",
      "    *   Mandate environmental performance standards.\n",
      "    *   Implement carbon pricing or emissions trading schemes.\n",
      "    *   Streamline permitting for sustainable projects.\n",
      "    *   Robust zoning laws that encourage mixed-use development and protect green spaces.\n",
      "3.  **Financing & Investment:**\n",
      "    *   Attract green finance, impact investors, and public-private partnerships.\n",
      "    *   Explore municipal green bonds.\n",
      "    *   Leverage national and international climate funds.\n",
      "4.  **Pilot Projects & Scalability:** Start with small, manageable pilot projects to test concepts, gather data, and demonstrate success before scaling up.\n",
      "5.  **Education & Capacity Building:** Invest in training for urban planners, engineers, policymakers, and the public on sustainable practices and climate change.\n",
      "\n",
      "### **Phase 4: Monitoring, Evaluation & Adaptive Management**\n",
      "\n",
      "1.  **Continuous Monitoring:** Regularly track progress against established KPIs using data from sensors, citizen feedback, and traditional surveys.\n",
      "2.  **Regular Review & Evaluation:** Conduct periodic reviews to assess the effectiveness of policies and interventions.\n",
      "3.  **Adaptive Management:** Be prepared to adjust strategies and plans based on monitoring data, emerging technologies, unforeseen challenges, and evolving community needs. This is critical for long-term resilience and flexibility in the face of rapid change.\n",
      "4.  **Transparency & Reporting:** Publish regular reports on the city's sustainability performance, fostering accountability and public trust.\n",
      "\n",
      "---\n",
      "\n",
      "**Challenges & Balancing Act:**\n",
      "\n",
      "The biggest challenge is often the **trade-offs**. For example:\n",
      "*   Economic growth often historically came at an environmental cost. The design must demonstrate how green economy can *drive* growth.\n",
      "*   New infrastructure might displace communities; social equity demands robust resettlement plans and community benefit agreements.\n",
      "*   Technological advancements raise privacy concerns; robust data governance and ethical AI principles are crucial.\n",
      "\n",
      "The \"balancing act\" is achieved not by compromising on each pillar, but by finding **synergies** where they reinforce each other. A healthy environment supports a productive economy and human well-being. A vibrant economy can fund sustainable infrastructure and social programs. Social equity ensures that the benefits of sustainability are shared by all, fostering a more resilient and cohesive community capable of adapting to future challenges.\n",
      "\n",
      "# Response from competitor 4\n",
      "\n",
      "Designing a sustainable urban environment that balances economic growth, social equity, and environmental conservation—while addressing climate change and leveraging technology—requires a holistic, systems-thinking approach. Here’s a step-by-step framework:\n",
      "\n",
      "### **1. Vision and Stakeholder Engagement**  \n",
      "- **Define Shared Goals**: Establish a clear vision integrating sustainability, equity, and resilience (e.g., carbon neutrality by 2050, zero displacement, green job creation).  \n",
      "- **Participatory Planning**: Engage communities, businesses, NGOs, and policymakers to ensure diverse needs are met (e.g., co-design workshops, digital platforms for feedback).  \n",
      "\n",
      "### **2. Compact, Mixed-Use Urban Design**  \n",
      "- **Transit-Oriented Development (TOD)**: Prioritize dense, walkable neighborhoods with mixed-income housing near public transit to reduce car dependency.  \n",
      "- **15-Minute City Concept**: Ensure access to jobs, schools, healthcare, and recreation within short distances.  \n",
      "- **Green Infrastructure**: Integrate parks, urban forests, and green roofs to mitigate heat islands and manage stormwater.  \n",
      "\n",
      "### **3. Climate-Resilient Infrastructure**  \n",
      "- **Adaptive Buildings**: Mandate net-zero energy designs, passive cooling, and flood-resistant materials.  \n",
      "- **Renewable Energy Microgrids**: Decentralize energy with solar/wind + battery storage to enhance resilience.  \n",
      "- **Blue-Green Systems**: Use permeable pavements, bioswales, and restored wetlands to combat flooding.  \n",
      "\n",
      "### **4. Equitable Economic Growth**  \n",
      "- **Green Jobs & Training**: Invest in renewable energy, circular economy (recycling, upcycling), and local agriculture.  \n",
      "- **Inclusive Zoning**: Reserve affordable housing units and protect against gentrification (e.g., community land trusts).  \n",
      "- **Support for Informal Sectors**: Integrate street vendors and gig workers into formal urban plans.  \n",
      "\n",
      "### **5. Smart & Low-Carbon Mobility**  \n",
      "- **Prioritize Public Transit**: Electric buses, bike lanes, and pedestrian-friendly streets.  \n",
      "- **Shared Mobility**: Promote carpooling, e-scooters, and autonomous shuttles to reduce private car ownership.  \n",
      "- **Freight Electrification**: Transition delivery fleets to EVs and optimize logistics with AI.  \n",
      "\n",
      "### **6. Circular Economy & Resource Efficiency**  \n",
      "- **Zero-Waste Systems**: Incentivize composting, recycling, and industrial symbiosis (waste = resource).  \n",
      "- **Water Reuse**: Implement greywater recycling and rainwater harvesting.  \n",
      "- **Sustainable Materials**: Use low-carbon concrete, recycled steel, and modular construction.  \n",
      "\n",
      "### **7. Technology for Sustainability & Equity**  \n",
      "- **Digital Twins**: Model urban systems (energy, traffic) to optimize planning.  \n",
      "- **IoT Sensors**: Monitor air quality, water use, and energy consumption in real time.  \n",
      "- **AI for Equity**: Use data to identify underserved areas (e.g., food deserts, transit gaps).  \n",
      "\n",
      "### **8. Governance & Policy Innovation**  \n",
      "- **Carbon Pricing & Green Bonds**: Fund sustainability projects via taxes on emissions/pollution.  \n",
      "- **Inclusive Policies**: Mandate social impact assessments for new developments.  \n",
      "- **Regional Collaboration**: Coordinate with neighboring cities on shared resources (water, energy grids).  \n",
      "\n",
      "### **9. Monitoring & Adaptive Management**  \n",
      "- **KPIs for Success**: Track metrics like GHG reductions, air quality, job creation, and affordability.  \n",
      "- **Iterative Feedback**: Use citizen science and digital dashboards to refine strategies.  \n",
      "\n",
      "### **Example: Copenhagen’s 2025 Carbon Neutral Plan**  \n",
      "- **Biking Infrastructure**: 50% commute by bike.  \n",
      "- **District Heating**: 98% from renewables.  \n",
      "- **Climate Adaptation**: Parks double as flood basins.  \n",
      "\n",
      "### **Key Trade-offs to Manage**  \n",
      "- **Density vs. Green Space**: High density reduces sprawl but requires careful green integration.  \n",
      "- **Tech vs. Privacy**: Smart cities must protect data rights.  \n",
      "- **Growth vs. Equity**: Ensure economic expansion doesn’t displace vulnerable groups.  \n",
      "\n",
      "By integrating these strategies, cities can become **prosperous, fair, and regenerative**—future-proofing against climate risks while improving quality of life. Would you like a deeper dive into any specific aspect?\n",
      "\n",
      "# Response from competitor 5\n",
      "\n",
      "Designing a sustainable urban environment requires a holistic approach that balances economic growth, social equity, and environmental conservation while considering the impact of climate change and technological advancements. Here's a comprehensive approach to achieve this balance:\n",
      "\n",
      "**I. Climate-Resilient Urban Planning**\n",
      "\n",
      "1. **Green Infrastructure**: Incorporate green spaces, parks, and green roofs to mitigate urban heat islands, manage stormwater runoff, and improve air quality.\n",
      "2. **Climate-Resilient Design**: Design buildings and infrastructure to withstand extreme weather events, such as sea-level rise, flooding, and droughts.\n",
      "3. **Adaptive Urban Planning**: Develop flexible and adaptable urban plans that can respond to changing climate conditions and emerging technologies.\n",
      "\n",
      "**II. Sustainable Transportation Systems**\n",
      "\n",
      "1. **Electrification of Transportation**: Promote the adoption of electric vehicles, public transportation, and non-motorized transportation options, such as walking and cycling.\n",
      "2. **Smart Traffic Management**: Implement intelligent transportation systems that optimize traffic flow, reduce congestion, and minimize emissions.\n",
      "3. **Multimodal Transportation**: Encourage the use of multiple transportation modes, including public transportation, walking, and cycling, to reduce reliance on personal vehicles.\n",
      "\n",
      "**III. Energy-Efficient and Renewable Energy Systems**\n",
      "\n",
      "1. **Renewable Energy Integration**: Incorporate renewable energy sources, such as solar, wind, and geothermal, into the urban energy mix.\n",
      "2. **Energy-Efficient Buildings**: Design buildings with energy-efficient systems, materials, and technologies to reduce energy consumption.\n",
      "3. **Smart Grids**: Implement advanced grid management systems that optimize energy distribution, reduce energy losses, and promote energy efficiency.\n",
      "\n",
      "**IV. Water Conservation and Management**\n",
      "\n",
      "1. **Water-Efficient Systems**: Implement water-efficient technologies, such as low-flow appliances and graywater reuse systems.\n",
      "2. **Rainwater Harvesting**: Collect and store rainwater for non-potable uses, such as irrigation and toilet flushing.\n",
      "3. **Flood-Resilient Design**: Design urban infrastructure to withstand flooding, including green infrastructure, flood-resistant construction, and smart stormwater management systems.\n",
      "\n",
      "**V. Waste Reduction and Management**\n",
      "\n",
      "1. **Zero-Waste Policies**: Implement policies and programs to reduce, reuse, and recycle waste, aiming for zero waste to landfill.\n",
      "2. **Circular Economy**: Foster a circular economy by promoting the sharing, leasing, and reuse of products and materials.\n",
      "3. **Waste-to-Energy**: Consider waste-to-energy technologies, such as anaerobic digestion or gasification, to generate energy from waste.\n",
      "\n",
      "**VI. Social Equity and Inclusion**\n",
      "\n",
      "1. **Affordable Housing**: Ensure that a proportion of new housing developments are affordable and accessible to low-income residents.\n",
      "2. **Inclusive Public Spaces**: Design public spaces that are accessible, safe, and welcoming to all members of the community.\n",
      "3. **Community Engagement**: Engage with local communities in the planning and decision-making process to ensure that their needs and concerns are addressed.\n",
      "\n",
      "**VII. Technological Advancements**\n",
      "\n",
      "1. **Smart City Technologies**: Leverage technologies, such as IoT sensors, data analytics, and artificial intelligence, to optimize urban systems and services.\n",
      "2. **Digital Infrastructure**: Invest in digital infrastructure, such as high-speed internet and data storage, to support innovation and entrepreneurship.\n",
      "3. **Emerging Technologies**: Explore the potential of emerging technologies, such as autonomous vehicles, drone delivery, and urban agriculture, to enhance urban sustainability and resilience.\n",
      "\n",
      "**VIII. Economic Growth and Development**\n",
      "\n",
      "1. **Green Economy**: Foster a green economy by promoting sustainable industries, such as renewable energy, sustainable manufacturing, and eco-tourism.\n",
      "2. **Innovation Hubs**: Create innovation hubs and incubators to support start-ups and entrepreneurs working on sustainable solutions.\n",
      "3. **Public-Private Partnerships**: Collaborate with private sector partners to finance and deliver sustainable infrastructure and services.\n",
      "\n",
      "By adopting this comprehensive approach, cities can create a sustainable urban environment that balances economic growth, social equity, and environmental conservation while addressing the challenges of climate change and technological advancements.\n",
      "\n",
      "\n",
      "\n",
      "Now respond with the JSON with the ranked order of the competitors, nothing else. Do not include markdown formatting or code blocks.\n"
     ]
    }
   ],
   "source": [
    "print(judge)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "judge_messages = [{\"role\": \"user\", \"content\": judge}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"results\": [\"3\", \"1\", \"4\", \"5\", \"2\"]}\n"
     ]
    }
   ],
   "source": [
    "# Judgement time!\n",
    "\n",
    "openai = OpenAI()\n",
    "response = openai.chat.completions.create(\n",
    "    model=\"o3-mini\",\n",
    "    messages=judge_messages,\n",
    ")\n",
    "results = response.choices[0].message.content\n",
    "print(results)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Rank 1: gemini-2.5-flash\n",
      "Rank 2: gpt-4o-mini\n",
      "Rank 3: deepseek-chat\n",
      "Rank 4: llama-3.3-70b-versatile\n",
      "Rank 5: claude-3-7-sonnet-latest\n"
     ]
    }
   ],
   "source": [
    "# OK let's turn this into results!\n",
    "\n",
    "results_dict = json.loads(results)\n",
    "ranks = results_dict[\"results\"]\n",
    "for index, result in enumerate(ranks):\n",
    "    competitor = competitors[int(result)-1]\n",
    "    print(f\"Rank {index+1}: {competitor}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table style=\"margin: 0; text-align: left; width:100%\">\n",
    "    <tr>\n",
    "        <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",
    "            <img src=\"../assets/exercise.png\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
    "        </td>\n",
    "        <td>\n",
    "            <h2 style=\"color:#ff7800;\">Exercise</h2>\n",
    "            <span style=\"color:#ff7800;\">Which pattern(s) did this use? Try updating this to add another Agentic design pattern.\n",
    "            </span>\n",
    "        </td>\n",
    "    </tr>\n",
    "</table>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table style=\"margin: 0; text-align: left; width:100%\">\n",
    "    <tr>\n",
    "        <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",
    "            <img src=\"../assets/business.png\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
    "        </td>\n",
    "        <td>\n",
    "            <h2 style=\"color:#00bfff;\">Commercial implications</h2>\n",
    "            <span style=\"color:#00bfff;\">These kinds of patterns - to send a task to multiple models, and evaluate results,\n",
    "            are common where you need to improve the quality of your LLM response. This approach can be universally applied\n",
    "            to business projects where accuracy is critical.\n",
    "            </span>\n",
    "        </td>\n",
    "    </tr>\n",
    "</table>"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}