File size: 149,522 Bytes
0af0679
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
{
 "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": 18,
   "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": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Always remember to do this!\n",
    "load_dotenv(override=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "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": 21,
   "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": 22,
   "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": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "messages"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "How would you evaluate the ethical implications of developing artificial intelligence that can autonomously make decisions in high-stakes situations, such as in healthcare or military applications, balancing the potential benefits against the risks of bias, accountability, and unintended consequences?\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": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "competitors = []\n",
    "answers = []\n",
    "messages = [{\"role\": \"user\", \"content\": question}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "Evaluating the ethical implications of developing artificial intelligence (AI) that can autonomously make decisions in high-stakes situations requires a nuanced consideration of various factors, including potential benefits, risks, and the broader social context in which such technologies will operate. Here’s a structured approach to analyze these implications:\n",
       "\n",
       "### Potential Benefits:\n",
       "\n",
       "1. **Improved Efficiency**: AI systems can analyze vast amounts of data far more quickly than humans, potentially leading to faster decision-making in critical situations such as diagnosing diseases or responding to military threats.\n",
       "\n",
       "2. **Consistency**: AI can provide decisions based on established protocols without human fatigue or emotional bias, which may lead to more consistent outcomes in areas like healthcare treatment plans or frontline military tactics.\n",
       "\n",
       "3. **Enhanced Capabilities**: In some scenarios, AI can support human decision-making by providing predictive analytics, suggesting interventions, or identifying patterns that human decision-makers might miss.\n",
       "\n",
       "4. **Resource Optimization**: AI can help allocate medical or military resources more effectively, potentially leading to better outcomes in public health scenarios or military engagements.\n",
       "\n",
       "### Risks and Ethical Concerns:\n",
       "\n",
       "1. **Bias**: AI systems can inherit and amplify biases present in the data on which they are trained. This can lead to unfair treatment in healthcare (e.g., racial or socioeconomic disparities in treatment recommendations) or biased military strategies. Ensuring fairness and equity in AI decision-making is critical.\n",
       "\n",
       "2. **Accountability**: When AI makes decisions, it can be challenging to attribute responsibility for outcomes. This raises concerns about accountability—who is held responsible when an AI makes a mistake? Clarity in accountability structures is vitally important, especially in life-and-death situations.\n",
       "\n",
       "3. **Transparency**: The complexity of many AI algorithms, especially deep learning models, can hinder transparency. Stakeholders need to understand how decisions are made to trust and accept AI-driven outcomes.\n",
       "\n",
       "4. **Unintended Consequences**: AI systems might produce unforeseen outcomes, especially in dynamic environments. For instance, if an AI in a military context misinterprets a situation, it could lead to unintended escalations. This unpredictability necessitates rigorous testing and risk assessment.\n",
       "\n",
       "5. **Moral and Ethical Considerations**: Autonomous systems might struggle with nuanced moral judgments. For instance, in healthcare, decisions about end-of-life care can be deeply personal and context-dependent, raising questions about whether AI should play a role in such sensitive areas.\n",
       "\n",
       "### Balancing Benefits and Risks:\n",
       "\n",
       "1. **Regulatory Frameworks**: Establishing comprehensive regulations and ethical guidelines for AI development and deployment is necessary to govern accountability, transparency, and bias mitigation. Regulatory bodies must reflect diverse perspectives, including ethicists, domain experts, and community representatives.\n",
       "\n",
       "2. **Human Oversight**: Incorporating human-in-the-loop systems can help ensure that critical decisions still involve human judgment, especially when ethical considerations are at stake. This hybrid approach could allow for quicker decision-making while retaining accountability.\n",
       "\n",
       "3. **Bias Mitigation Strategies**: Actively working to identify, test, and mitigate biases in AI systems is essential. This includes diverse data collection, algorithmic transparency, and continuous monitoring of AI outputs.\n",
       "\n",
       "4. **Public Engagement**: Engaging with stakeholders—including the public, affected communities, and domain experts—can foster trust and ensure that AI systems are developed in alignment with societal values and needs.\n",
       "\n",
       "5. **Continuous Learning and Adaptation**: AI systems should be designed to learn from their environments and improve over time. This adaptability can help address unintended consequences and align more closely with ethical standards as they evolve.\n",
       "\n",
       "### Conclusion:\n",
       "\n",
       "Developing autonomous AI in high-stakes contexts is a double-edged sword that requires careful ethical scrutiny. While the potential benefits are substantial, they must be weighed against serious risks related to bias, accountability, transparency, and moral implications. A comprehensive approach that includes rigorous testing, regulatory frameworks, human oversight, and active public engagement can facilitate the responsible development of AI technologies that serve the best interests of society."
      ],
      "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": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "# Ethical Implications of Autonomous AI in High-Stakes Domains\n",
       "\n",
       "This is a complex ethical question that requires balancing several considerations:\n",
       "\n",
       "## Potential Benefits\n",
       "- Healthcare: AI could provide faster diagnoses, reach underserved populations, and detect patterns humans might miss\n",
       "- Military: Could reduce human casualties and potentially make more consistent decisions under pressure\n",
       "\n",
       "## Significant Concerns\n",
       "- **Accountability gap**: When AI makes harmful decisions, who bears responsibility - developers, deployers, or the system itself?\n",
       "- **Bias amplification**: AI systems trained on historical data may perpetuate or amplify existing societal biases\n",
       "- **Transparency challenges**: Complex AI systems often function as \"black boxes,\" making oversight difficult\n",
       "- **Value alignment**: Ensuring AI systems properly understand and implement human values and intentions\n",
       "\n",
       "## Balance Considerations\n",
       "- Proportional oversight: More autonomous systems in higher-stakes domains require more rigorous testing and human supervision\n",
       "- Explainability requirements may need to be stronger in contexts like healthcare than in other applications\n",
       "- The timeline for deployment should match our ability to solve safety and alignment challenges\n",
       "\n",
       "I believe thoughtful governance frameworks, inclusive development processes, and ongoing monitoring are essential to responsibly navigate these tradeoffs."
      ],
      "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": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "Evaluating the ethical implications of autonomous AI in high-stakes situations like healthcare and military applications is a complex undertaking. It requires careful consideration of potential benefits, risks, and the interplay of various ethical principles. Here's a structured approach:\n",
       "\n",
       "**1. Identifying Potential Benefits and Harms:**\n",
       "\n",
       "*   **Healthcare:**\n",
       "    *   **Benefits:**\n",
       "        *   Improved accuracy in diagnoses and treatment plans.\n",
       "        *   Increased access to healthcare, especially in underserved areas.\n",
       "        *   Reduced human error in complex procedures.\n",
       "        *   Faster response times in emergency situations.\n",
       "        *   Personalized medicine tailored to individual patient needs.\n",
       "    *   **Harms:**\n",
       "        *   Misdiagnosis or inappropriate treatment due to biased data or flawed algorithms.\n",
       "        *   Erosion of the doctor-patient relationship and loss of human empathy.\n",
       "        *   Privacy violations due to the collection and use of sensitive patient data.\n",
       "        *   Deskilling of medical professionals as they rely more on AI.\n",
       "        *   Exacerbation of existing health disparities if AI systems are trained on biased data.\n",
       "\n",
       "*   **Military Applications:**\n",
       "    *   **Benefits:**\n",
       "        *   Reduced casualties by removing soldiers from dangerous situations.\n",
       "        *   Improved precision in targeting and minimizing collateral damage.\n",
       "        *   Faster decision-making in combat situations.\n",
       "        *   Enhanced situational awareness through real-time data analysis.\n",
       "    *   **Harms:**\n",
       "        *   Unintended escalation of conflicts due to algorithmic errors.\n",
       "        *   Loss of human control over lethal force.\n",
       "        *   Dehumanization of warfare.\n",
       "        *   Increased risk of autonomous weapons falling into the wrong hands.\n",
       "        *   Lack of accountability for unintended consequences.\n",
       "\n",
       "**2. Addressing Ethical Principles:**\n",
       "\n",
       "*   **Autonomy and Human Control:**\n",
       "    *   How much control should humans retain over AI decisions?\n",
       "    *   Can AI systems be designed to respect human autonomy and values?\n",
       "    *   What safeguards can be implemented to prevent AI from exceeding its intended scope of authority?\n",
       "\n",
       "*   **Beneficence and Non-Maleficence (Do good and do no harm):**\n",
       "    *   How can we ensure that AI systems are designed to maximize benefits and minimize risks?\n",
       "    *   What measures can be taken to mitigate the potential for harm, such as bias, errors, and unintended consequences?\n",
       "    *   How do we balance the potential benefits against the risks, especially when lives are at stake?\n",
       "\n",
       "*   **Justice and Fairness:**\n",
       "    *   How can we ensure that AI systems are fair and equitable, and do not discriminate against certain groups?\n",
       "    *   How can we address the potential for bias in training data and algorithms?\n",
       "    *   How can we ensure that everyone has equal access to the benefits of AI, regardless of their socioeconomic status or background?\n",
       "\n",
       "*   **Accountability and Transparency:**\n",
       "    *   Who is responsible when an AI system makes a mistake or causes harm?\n",
       "    *   How can we ensure that AI systems are transparent and explainable, so that users can understand how they arrived at their decisions?\n",
       "    *   What mechanisms can be put in place to monitor and audit AI systems to ensure that they are performing as intended and are not causing unintended harm?\n",
       "\n",
       "*   **Privacy and Security:**\n",
       "    *   How can we protect the privacy and security of sensitive data used by AI systems?\n",
       "    *   What measures can be taken to prevent unauthorized access to or misuse of AI systems?\n",
       "    *   How can we ensure that AI systems comply with relevant data protection regulations?\n",
       "\n",
       "**3. Mitigating Risks:**\n",
       "\n",
       "*   **Bias Detection and Mitigation:** Implement rigorous testing and validation processes to identify and mitigate bias in training data and algorithms. Employ techniques such as data augmentation, fairness-aware algorithms, and adversarial debiasing.\n",
       "*   **Explainability and Interpretability:** Design AI systems that provide clear explanations for their decisions, allowing users to understand the reasoning behind the recommendations.  Use techniques like SHAP values, LIME, and attention mechanisms to highlight important features.\n",
       "*   **Robustness and Reliability:** Develop AI systems that are robust to noisy data, adversarial attacks, and unforeseen circumstances. Conduct thorough testing and validation to ensure that the systems perform reliably in real-world scenarios.\n",
       "*   **Human Oversight and Control:** Implement mechanisms for human oversight and control, allowing users to intervene and override AI decisions when necessary.  Design systems with clear escalation pathways for complex or uncertain situations.\n",
       "*   **Continuous Monitoring and Evaluation:**  Establish a system for continuous monitoring and evaluation of AI system performance, identifying and addressing any issues that arise over time.  Regularly audit the system for bias, accuracy, and fairness.\n",
       "*   **Ethical Guidelines and Regulations:** Develop clear ethical guidelines and regulations for the development and deployment of AI in high-stakes situations.  Promote responsible AI practices through education, training, and certification programs.\n",
       "\n",
       "**4. Frameworks and Tools:**\n",
       "\n",
       "*   **Ethical Impact Assessments (EIAs):**  Conduct EIAs before deploying AI systems to identify and mitigate potential ethical risks.\n",
       "*   **AI Ethics Toolkits:**  Utilize AI ethics toolkits and frameworks to guide the development and deployment of responsible AI systems.\n",
       "*   **Stakeholder Engagement:**  Involve a wide range of stakeholders, including experts, policymakers, and the public, in the development and deployment of AI systems.\n",
       "*   **Public Debate and Education:**  Promote public debate and education about the ethical implications of AI.\n",
       "\n",
       "**5.  Specific Considerations for Healthcare and Military:**\n",
       "\n",
       "*   **Healthcare:** Patient autonomy and the physician-patient relationship must be central.  Transparent algorithms are crucial for trust.  Regulations should protect patient data and prevent discrimination.\n",
       "*   **Military:** International humanitarian law must be strictly adhered to.  Human control over lethal force must be maintained. Clear lines of accountability are essential.\n",
       "\n",
       "**Conclusion:**\n",
       "\n",
       "Developing autonomous AI for high-stakes situations requires a comprehensive and ethical approach that prioritizes human well-being, fairness, and accountability. By carefully considering the potential benefits and risks, addressing ethical principles, and implementing appropriate safeguards, we can harness the power of AI while mitigating the risks of unintended consequences.  A proactive, multidisciplinary, and constantly evolving approach is necessary to navigate the complex ethical landscape of autonomous AI in these critical domains.\n"
      ],
      "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.0-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": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "The ethical implications of developing autonomous AI for high-stakes decision-making in fields like healthcare and military applications are profound and multifaceted. Below is a structured evaluation of the key considerations, balancing potential benefits against risks:\n",
       "\n",
       "### **Potential Benefits**  \n",
       "1. **Efficiency & Precision**  \n",
       "   - In healthcare, AI can diagnose diseases faster and more accurately than humans, improving patient outcomes (e.g., radiology AI detecting tumors).  \n",
       "   - In military contexts, autonomous systems could reduce human error in defensive operations.  \n",
       "\n",
       "2. **Scalability & Accessibility**  \n",
       "   - AI can provide expert-level decision-making in underserved regions where human specialists are scarce.  \n",
       "   - Autonomous drones could deliver medical supplies in conflict zones without risking human lives.  \n",
       "\n",
       "3. **Reduction of Human Risk**  \n",
       "   - In warfare, AI-driven systems could minimize soldier casualties by handling dangerous reconnaissance or defusing explosives.  \n",
       "\n",
       "### **Key Ethical Risks & Challenges**  \n",
       "1. **Bias & Fairness**  \n",
       "   - AI trained on biased data may perpetuate discrimination (e.g., underdiagnosing diseases in minority groups).  \n",
       "   - Military AI could misidentify targets based on flawed training data, leading to civilian harm.  \n",
       "\n",
       "2. **Accountability & Responsibility**  \n",
       "   - If an AI system makes a fatal error in surgery or warfare, who is liable? The developer, operator, or the AI itself?  \n",
       "   - Lack of clear legal frameworks complicates accountability.  \n",
       "\n",
       "3. **Unintended Consequences & Loss of Control**  \n",
       "   - Autonomous weapons could escalate conflicts unpredictably if hacked or misused.  \n",
       "   - Over-reliance on AI in healthcare might erode human judgment and patient trust.  \n",
       "\n",
       "4. **Transparency & Explainability**  \n",
       "   - Many AI systems (e.g., deep learning models) are \"black boxes,\" making it hard to justify decisions.  \n",
       "   - In life-or-death scenarios, the inability to explain AI reasoning is ethically problematic.  \n",
       "\n",
       "### **Balancing Benefits & Risks: Ethical Frameworks**  \n",
       "1. **Human-in-the-Loop (HITL) Oversight**  \n",
       "   - Critical decisions (e.g., lethal force in warfare, major surgeries) should require human confirmation.  \n",
       "   - Ensures accountability while leveraging AI’s efficiency.  \n",
       "\n",
       "2. **Robust Bias Mitigation & Auditing**  \n",
       "   - Diverse training datasets and continuous bias testing.  \n",
       "   - Independent oversight bodies to audit AI systems pre-deployment.  \n",
       "\n",
       "3. **International Regulations & Norms**  \n",
       "   - Bans or strict treaties on fully autonomous weapons (e.g., UN discussions on lethal autonomous weapons).  \n",
       "   - Ethical guidelines for medical AI (e.g., WHO’s principles on AI in health).  \n",
       "\n",
       "4. **Explainable AI (XAI) Development**  \n",
       "   - Prioritizing interpretable models in high-stakes fields to ensure decisions can be scrutinized.  \n",
       "\n",
       "### **Conclusion**  \n",
       "While autonomous AI offers transformative potential in healthcare and defense, its ethical risks demand rigorous safeguards. The balance hinges on **transparency, accountability, and human oversight**—ensuring AI augments rather than replaces human judgment in morally consequential domains. Without these guardrails, the risks of harm, bias, and loss of control could outweigh the benefits. Policymakers, technologists, and ethicists must collaborate to establish boundaries that maximize societal good while minimizing harm."
      ],
      "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": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "Evaluating the ethical implications of developing artificial intelligence (AI) that can autonomously make decisions in high-stakes situations requires a comprehensive analysis of the potential benefits and risks. Here's a framework to consider:\n",
       "\n",
       "**Potential Benefits:**\n",
       "\n",
       "1. **Improved decision-making**: AI can process vast amounts of data, identify patterns, and make decisions faster and more accurately than humans in certain situations.\n",
       "2. **Enhanced efficiency**: AI can automate routine tasks, freeing up human resources for more complex and high-value tasks.\n",
       "3. **Increased accessibility**: AI can provide decision-making support in areas where human expertise is scarce or unavailable.\n",
       "4. **Personalized care**: AI can help tailor healthcare decisions to individual patients' needs, leading to better outcomes.\n",
       "\n",
       "**Risks and Concerns:**\n",
       "\n",
       "1. **Bias and discrimination**: AI systems can perpetuate and amplify existing biases if trained on biased data, leading to unfair outcomes.\n",
       "2. **Lack of accountability**: As AI systems make autonomous decisions, it can be challenging to determine responsibility for errors or adverse outcomes.\n",
       "3. **Unintended consequences**: AI systems can produce unintended consequences, such as unforeseen side effects or interactions with other systems.\n",
       "4. **Cybersecurity risks**: AI systems can be vulnerable to cyber attacks, compromising sensitive data and decision-making processes.\n",
       "5. **Transparency and explainability**: AI systems can be difficult to interpret, making it challenging to understand the reasoning behind their decisions.\n",
       "\n",
       "**Ethical Considerations:**\n",
       "\n",
       "1. **Respect for autonomy**: AI systems should be designed to respect human autonomy and decision-making capacity.\n",
       "2. **Non-maleficence**: AI systems should be designed to minimize harm and avoid causing unnecessary harm.\n",
       "3. **Beneficence**: AI systems should be designed to promote the well-being and best interests of individuals and society.\n",
       "4. **Justice**: AI systems should be designed to ensure fairness, equity, and distributive justice.\n",
       "\n",
       "**Mitigation Strategies:**\n",
       "\n",
       "1. **Data curation**: Ensure that training data is diverse, representative, and free from bias.\n",
       "2. **Algorithmic auditing**: Regularly audit AI systems for bias and errors.\n",
       "3. **Human oversight**: Implement human oversight and review processes to detect and correct errors.\n",
       "4. **Explainability and transparency**: Develop AI systems that provide clear explanations for their decisions.\n",
       "5. **Accountability mechanisms**: Establish clear accountability mechanisms for errors or adverse outcomes.\n",
       "6. **Cybersecurity measures**: Implement robust cybersecurity measures to protect AI systems and sensitive data.\n",
       "7. **Ethics guidelines and regulations**: Develop and enforce ethics guidelines and regulations for AI development and deployment.\n",
       "\n",
       "**Best Practices:**\n",
       "\n",
       "1. **Multidisciplinary development teams**: Assemble teams with diverse expertise, including ethicists, to ensure that AI systems are developed with ethical considerations in mind.\n",
       "2. **Inclusive and diverse testing**: Test AI systems with diverse datasets and user groups to identify and address potential biases.\n",
       "3. **Continuous monitoring and evaluation**: Regularly monitor and evaluate AI systems for performance, safety, and ethical implications.\n",
       "4. **Transparency and communication**: Communicate clearly with stakeholders about AI system capabilities, limitations, and potential risks.\n",
       "5. **Ongoing education and training**: Provide ongoing education and training for developers, deployers, and users of AI systems to ensure they understand the ethical implications of AI decision-making.\n",
       "\n",
       "By considering these factors and implementing mitigation strategies, we can develop AI systems that balance the potential benefits of autonomous decision-making with the need to address ethical concerns and minimize risks."
      ],
      "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": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# !ollama pull llama3.2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "Evaluating the ethical implications of developing autonomous AI for high-stakes decision-making requires a comprehensive and multi-disciplinary approach. Here's a framework to consider the potential benefits and risks, and balance them accordingly:\n",
       "\n",
       "**Potential Benefits:**\n",
       "\n",
       "1. Enhanced efficiency: Autonomous AI can process vast amounts of data quickly and accurately, leading to faster decision-making in high-stakes situations.\n",
       "2. Improved accuracy: AI can reduce human error by analyzing objective data and making decisions based on evidence-based criteria.\n",
       "3. Scalability: Autonomous AI can provide consistent results across multiple patients or scenarios, without the variability introduced by human factors.\n",
       "\n",
       "**Potential Risks:**\n",
       "\n",
       "1. **Bias:** AI systems can perpetuate pre-existing biases if they are trained using biased data or algorithms that replicate discriminatory patterns.\n",
       "2. **Accountability:** As AI systems take on more decision-making authority, it becomes increasingly difficult to assign responsibility for errors or harm caused by those decisions.\n",
       "3. **Unintended Consequences:** AI systems may produce unforeseen outcomes due to their inability to fully comprehend the complexity of human experience.\n",
       "4. **Privacy and Security:** Autonomous AI in high-stakes situations can raise significant concerns regarding patient confidentiality, intellectual property protection, and data security.\n",
       "\n",
       "**Key Ethical Considerations:**\n",
       "\n",
       "1. **Value Alignment**: Ensure that AI systems align with core human values, such as compassion, dignity, and respect for autonomy.\n",
       "2. **Transparency and Explainability**: Develop AI systems that provide transparent decision-making processes, allowing humans to understand the reasoning behind decisions.\n",
       "3. **Equity and Fairness**: Implement measures to prevent bias in AI, ensuring fairness and equity across diverse populations.\n",
       "4. **Human Oversight and Review**: Establish mechanisms for human review and intervention to ensure accountability and correct potential errors or biases.\n",
       "5. **Responsible Development**: Foster a culture of responsible development, prioritizing safety, efficacy, and societal impact.\n",
       "\n",
       "**Recommendations:**\n",
       "\n",
       "1. Conduct thorough risk assessments and engage in open dialogue with stakeholders, including patients, healthcare professionals, and civil society representatives.\n",
       "2. Establish independent review boards to monitor AI system development, deployment, and performance.\n",
       "3. Develop comprehensive guidelines for data collection, processing, and storage, ensuring patient confidentiality and intellectual property protection.\n",
       "4. Foster international collaboration on AI governance, regulatory frameworks, and best practices to address global concerns.\n",
       "5. Invest in AI literacy initiatives to educate professionals and the general public about AI systems, their limitations, and potential risks.\n",
       "\n",
       "By following this framework and engaging in ongoing dialogue with stakeholders, we can ensure that autonomous AI developments are guided by ethical principles, prioritizing human well-being, safety, and dignity."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "ollama = OpenAI(base_url='http://localhost:11434/v1', api_key='ollama')\n",
    "model_name = \"llama3.2:latest\"\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": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['gpt-4o-mini', 'claude-3-7-sonnet-latest', 'gemini-2.0-flash', 'deepseek-chat', 'llama-3.3-70b-versatile', 'llama3.2:latest']\n",
      "['Evaluating the ethical implications of developing artificial intelligence (AI) that can autonomously make decisions in high-stakes situations requires a nuanced consideration of various factors, including potential benefits, risks, and the broader social context in which such technologies will operate. Here’s a structured approach to analyze these implications:\\n\\n### Potential Benefits:\\n\\n1. **Improved Efficiency**: AI systems can analyze vast amounts of data far more quickly than humans, potentially leading to faster decision-making in critical situations such as diagnosing diseases or responding to military threats.\\n\\n2. **Consistency**: AI can provide decisions based on established protocols without human fatigue or emotional bias, which may lead to more consistent outcomes in areas like healthcare treatment plans or frontline military tactics.\\n\\n3. **Enhanced Capabilities**: In some scenarios, AI can support human decision-making by providing predictive analytics, suggesting interventions, or identifying patterns that human decision-makers might miss.\\n\\n4. **Resource Optimization**: AI can help allocate medical or military resources more effectively, potentially leading to better outcomes in public health scenarios or military engagements.\\n\\n### Risks and Ethical Concerns:\\n\\n1. **Bias**: AI systems can inherit and amplify biases present in the data on which they are trained. This can lead to unfair treatment in healthcare (e.g., racial or socioeconomic disparities in treatment recommendations) or biased military strategies. Ensuring fairness and equity in AI decision-making is critical.\\n\\n2. **Accountability**: When AI makes decisions, it can be challenging to attribute responsibility for outcomes. This raises concerns about accountability—who is held responsible when an AI makes a mistake? Clarity in accountability structures is vitally important, especially in life-and-death situations.\\n\\n3. **Transparency**: The complexity of many AI algorithms, especially deep learning models, can hinder transparency. Stakeholders need to understand how decisions are made to trust and accept AI-driven outcomes.\\n\\n4. **Unintended Consequences**: AI systems might produce unforeseen outcomes, especially in dynamic environments. For instance, if an AI in a military context misinterprets a situation, it could lead to unintended escalations. This unpredictability necessitates rigorous testing and risk assessment.\\n\\n5. **Moral and Ethical Considerations**: Autonomous systems might struggle with nuanced moral judgments. For instance, in healthcare, decisions about end-of-life care can be deeply personal and context-dependent, raising questions about whether AI should play a role in such sensitive areas.\\n\\n### Balancing Benefits and Risks:\\n\\n1. **Regulatory Frameworks**: Establishing comprehensive regulations and ethical guidelines for AI development and deployment is necessary to govern accountability, transparency, and bias mitigation. Regulatory bodies must reflect diverse perspectives, including ethicists, domain experts, and community representatives.\\n\\n2. **Human Oversight**: Incorporating human-in-the-loop systems can help ensure that critical decisions still involve human judgment, especially when ethical considerations are at stake. This hybrid approach could allow for quicker decision-making while retaining accountability.\\n\\n3. **Bias Mitigation Strategies**: Actively working to identify, test, and mitigate biases in AI systems is essential. This includes diverse data collection, algorithmic transparency, and continuous monitoring of AI outputs.\\n\\n4. **Public Engagement**: Engaging with stakeholders—including the public, affected communities, and domain experts—can foster trust and ensure that AI systems are developed in alignment with societal values and needs.\\n\\n5. **Continuous Learning and Adaptation**: AI systems should be designed to learn from their environments and improve over time. This adaptability can help address unintended consequences and align more closely with ethical standards as they evolve.\\n\\n### Conclusion:\\n\\nDeveloping autonomous AI in high-stakes contexts is a double-edged sword that requires careful ethical scrutiny. While the potential benefits are substantial, they must be weighed against serious risks related to bias, accountability, transparency, and moral implications. A comprehensive approach that includes rigorous testing, regulatory frameworks, human oversight, and active public engagement can facilitate the responsible development of AI technologies that serve the best interests of society.', '# Ethical Implications of Autonomous AI in High-Stakes Domains\\n\\nThis is a complex ethical question that requires balancing several considerations:\\n\\n## Potential Benefits\\n- Healthcare: AI could provide faster diagnoses, reach underserved populations, and detect patterns humans might miss\\n- Military: Could reduce human casualties and potentially make more consistent decisions under pressure\\n\\n## Significant Concerns\\n- **Accountability gap**: When AI makes harmful decisions, who bears responsibility - developers, deployers, or the system itself?\\n- **Bias amplification**: AI systems trained on historical data may perpetuate or amplify existing societal biases\\n- **Transparency challenges**: Complex AI systems often function as \"black boxes,\" making oversight difficult\\n- **Value alignment**: Ensuring AI systems properly understand and implement human values and intentions\\n\\n## Balance Considerations\\n- Proportional oversight: More autonomous systems in higher-stakes domains require more rigorous testing and human supervision\\n- Explainability requirements may need to be stronger in contexts like healthcare than in other applications\\n- The timeline for deployment should match our ability to solve safety and alignment challenges\\n\\nI believe thoughtful governance frameworks, inclusive development processes, and ongoing monitoring are essential to responsibly navigate these tradeoffs.', \"Evaluating the ethical implications of autonomous AI in high-stakes situations like healthcare and military applications is a complex undertaking. It requires careful consideration of potential benefits, risks, and the interplay of various ethical principles. Here's a structured approach:\\n\\n**1. Identifying Potential Benefits and Harms:**\\n\\n*   **Healthcare:**\\n    *   **Benefits:**\\n        *   Improved accuracy in diagnoses and treatment plans.\\n        *   Increased access to healthcare, especially in underserved areas.\\n        *   Reduced human error in complex procedures.\\n        *   Faster response times in emergency situations.\\n        *   Personalized medicine tailored to individual patient needs.\\n    *   **Harms:**\\n        *   Misdiagnosis or inappropriate treatment due to biased data or flawed algorithms.\\n        *   Erosion of the doctor-patient relationship and loss of human empathy.\\n        *   Privacy violations due to the collection and use of sensitive patient data.\\n        *   Deskilling of medical professionals as they rely more on AI.\\n        *   Exacerbation of existing health disparities if AI systems are trained on biased data.\\n\\n*   **Military Applications:**\\n    *   **Benefits:**\\n        *   Reduced casualties by removing soldiers from dangerous situations.\\n        *   Improved precision in targeting and minimizing collateral damage.\\n        *   Faster decision-making in combat situations.\\n        *   Enhanced situational awareness through real-time data analysis.\\n    *   **Harms:**\\n        *   Unintended escalation of conflicts due to algorithmic errors.\\n        *   Loss of human control over lethal force.\\n        *   Dehumanization of warfare.\\n        *   Increased risk of autonomous weapons falling into the wrong hands.\\n        *   Lack of accountability for unintended consequences.\\n\\n**2. Addressing Ethical Principles:**\\n\\n*   **Autonomy and Human Control:**\\n    *   How much control should humans retain over AI decisions?\\n    *   Can AI systems be designed to respect human autonomy and values?\\n    *   What safeguards can be implemented to prevent AI from exceeding its intended scope of authority?\\n\\n*   **Beneficence and Non-Maleficence (Do good and do no harm):**\\n    *   How can we ensure that AI systems are designed to maximize benefits and minimize risks?\\n    *   What measures can be taken to mitigate the potential for harm, such as bias, errors, and unintended consequences?\\n    *   How do we balance the potential benefits against the risks, especially when lives are at stake?\\n\\n*   **Justice and Fairness:**\\n    *   How can we ensure that AI systems are fair and equitable, and do not discriminate against certain groups?\\n    *   How can we address the potential for bias in training data and algorithms?\\n    *   How can we ensure that everyone has equal access to the benefits of AI, regardless of their socioeconomic status or background?\\n\\n*   **Accountability and Transparency:**\\n    *   Who is responsible when an AI system makes a mistake or causes harm?\\n    *   How can we ensure that AI systems are transparent and explainable, so that users can understand how they arrived at their decisions?\\n    *   What mechanisms can be put in place to monitor and audit AI systems to ensure that they are performing as intended and are not causing unintended harm?\\n\\n*   **Privacy and Security:**\\n    *   How can we protect the privacy and security of sensitive data used by AI systems?\\n    *   What measures can be taken to prevent unauthorized access to or misuse of AI systems?\\n    *   How can we ensure that AI systems comply with relevant data protection regulations?\\n\\n**3. Mitigating Risks:**\\n\\n*   **Bias Detection and Mitigation:** Implement rigorous testing and validation processes to identify and mitigate bias in training data and algorithms. Employ techniques such as data augmentation, fairness-aware algorithms, and adversarial debiasing.\\n*   **Explainability and Interpretability:** Design AI systems that provide clear explanations for their decisions, allowing users to understand the reasoning behind the recommendations.  Use techniques like SHAP values, LIME, and attention mechanisms to highlight important features.\\n*   **Robustness and Reliability:** Develop AI systems that are robust to noisy data, adversarial attacks, and unforeseen circumstances. Conduct thorough testing and validation to ensure that the systems perform reliably in real-world scenarios.\\n*   **Human Oversight and Control:** Implement mechanisms for human oversight and control, allowing users to intervene and override AI decisions when necessary.  Design systems with clear escalation pathways for complex or uncertain situations.\\n*   **Continuous Monitoring and Evaluation:**  Establish a system for continuous monitoring and evaluation of AI system performance, identifying and addressing any issues that arise over time.  Regularly audit the system for bias, accuracy, and fairness.\\n*   **Ethical Guidelines and Regulations:** Develop clear ethical guidelines and regulations for the development and deployment of AI in high-stakes situations.  Promote responsible AI practices through education, training, and certification programs.\\n\\n**4. Frameworks and Tools:**\\n\\n*   **Ethical Impact Assessments (EIAs):**  Conduct EIAs before deploying AI systems to identify and mitigate potential ethical risks.\\n*   **AI Ethics Toolkits:**  Utilize AI ethics toolkits and frameworks to guide the development and deployment of responsible AI systems.\\n*   **Stakeholder Engagement:**  Involve a wide range of stakeholders, including experts, policymakers, and the public, in the development and deployment of AI systems.\\n*   **Public Debate and Education:**  Promote public debate and education about the ethical implications of AI.\\n\\n**5.  Specific Considerations for Healthcare and Military:**\\n\\n*   **Healthcare:** Patient autonomy and the physician-patient relationship must be central.  Transparent algorithms are crucial for trust.  Regulations should protect patient data and prevent discrimination.\\n*   **Military:** International humanitarian law must be strictly adhered to.  Human control over lethal force must be maintained. Clear lines of accountability are essential.\\n\\n**Conclusion:**\\n\\nDeveloping autonomous AI for high-stakes situations requires a comprehensive and ethical approach that prioritizes human well-being, fairness, and accountability. By carefully considering the potential benefits and risks, addressing ethical principles, and implementing appropriate safeguards, we can harness the power of AI while mitigating the risks of unintended consequences.  A proactive, multidisciplinary, and constantly evolving approach is necessary to navigate the complex ethical landscape of autonomous AI in these critical domains.\\n\", 'The ethical implications of developing autonomous AI for high-stakes decision-making in fields like healthcare and military applications are profound and multifaceted. Below is a structured evaluation of the key considerations, balancing potential benefits against risks:\\n\\n### **Potential Benefits**  \\n1. **Efficiency & Precision**  \\n   - In healthcare, AI can diagnose diseases faster and more accurately than humans, improving patient outcomes (e.g., radiology AI detecting tumors).  \\n   - In military contexts, autonomous systems could reduce human error in defensive operations.  \\n\\n2. **Scalability & Accessibility**  \\n   - AI can provide expert-level decision-making in underserved regions where human specialists are scarce.  \\n   - Autonomous drones could deliver medical supplies in conflict zones without risking human lives.  \\n\\n3. **Reduction of Human Risk**  \\n   - In warfare, AI-driven systems could minimize soldier casualties by handling dangerous reconnaissance or defusing explosives.  \\n\\n### **Key Ethical Risks & Challenges**  \\n1. **Bias & Fairness**  \\n   - AI trained on biased data may perpetuate discrimination (e.g., underdiagnosing diseases in minority groups).  \\n   - Military AI could misidentify targets based on flawed training data, leading to civilian harm.  \\n\\n2. **Accountability & Responsibility**  \\n   - If an AI system makes a fatal error in surgery or warfare, who is liable? The developer, operator, or the AI itself?  \\n   - Lack of clear legal frameworks complicates accountability.  \\n\\n3. **Unintended Consequences & Loss of Control**  \\n   - Autonomous weapons could escalate conflicts unpredictably if hacked or misused.  \\n   - Over-reliance on AI in healthcare might erode human judgment and patient trust.  \\n\\n4. **Transparency & Explainability**  \\n   - Many AI systems (e.g., deep learning models) are \"black boxes,\" making it hard to justify decisions.  \\n   - In life-or-death scenarios, the inability to explain AI reasoning is ethically problematic.  \\n\\n### **Balancing Benefits & Risks: Ethical Frameworks**  \\n1. **Human-in-the-Loop (HITL) Oversight**  \\n   - Critical decisions (e.g., lethal force in warfare, major surgeries) should require human confirmation.  \\n   - Ensures accountability while leveraging AI’s efficiency.  \\n\\n2. **Robust Bias Mitigation & Auditing**  \\n   - Diverse training datasets and continuous bias testing.  \\n   - Independent oversight bodies to audit AI systems pre-deployment.  \\n\\n3. **International Regulations & Norms**  \\n   - Bans or strict treaties on fully autonomous weapons (e.g., UN discussions on lethal autonomous weapons).  \\n   - Ethical guidelines for medical AI (e.g., WHO’s principles on AI in health).  \\n\\n4. **Explainable AI (XAI) Development**  \\n   - Prioritizing interpretable models in high-stakes fields to ensure decisions can be scrutinized.  \\n\\n### **Conclusion**  \\nWhile autonomous AI offers transformative potential in healthcare and defense, its ethical risks demand rigorous safeguards. The balance hinges on **transparency, accountability, and human oversight**—ensuring AI augments rather than replaces human judgment in morally consequential domains. Without these guardrails, the risks of harm, bias, and loss of control could outweigh the benefits. Policymakers, technologists, and ethicists must collaborate to establish boundaries that maximize societal good while minimizing harm.', \"Evaluating the ethical implications of developing artificial intelligence (AI) that can autonomously make decisions in high-stakes situations requires a comprehensive analysis of the potential benefits and risks. Here's a framework to consider:\\n\\n**Potential Benefits:**\\n\\n1. **Improved decision-making**: AI can process vast amounts of data, identify patterns, and make decisions faster and more accurately than humans in certain situations.\\n2. **Enhanced efficiency**: AI can automate routine tasks, freeing up human resources for more complex and high-value tasks.\\n3. **Increased accessibility**: AI can provide decision-making support in areas where human expertise is scarce or unavailable.\\n4. **Personalized care**: AI can help tailor healthcare decisions to individual patients' needs, leading to better outcomes.\\n\\n**Risks and Concerns:**\\n\\n1. **Bias and discrimination**: AI systems can perpetuate and amplify existing biases if trained on biased data, leading to unfair outcomes.\\n2. **Lack of accountability**: As AI systems make autonomous decisions, it can be challenging to determine responsibility for errors or adverse outcomes.\\n3. **Unintended consequences**: AI systems can produce unintended consequences, such as unforeseen side effects or interactions with other systems.\\n4. **Cybersecurity risks**: AI systems can be vulnerable to cyber attacks, compromising sensitive data and decision-making processes.\\n5. **Transparency and explainability**: AI systems can be difficult to interpret, making it challenging to understand the reasoning behind their decisions.\\n\\n**Ethical Considerations:**\\n\\n1. **Respect for autonomy**: AI systems should be designed to respect human autonomy and decision-making capacity.\\n2. **Non-maleficence**: AI systems should be designed to minimize harm and avoid causing unnecessary harm.\\n3. **Beneficence**: AI systems should be designed to promote the well-being and best interests of individuals and society.\\n4. **Justice**: AI systems should be designed to ensure fairness, equity, and distributive justice.\\n\\n**Mitigation Strategies:**\\n\\n1. **Data curation**: Ensure that training data is diverse, representative, and free from bias.\\n2. **Algorithmic auditing**: Regularly audit AI systems for bias and errors.\\n3. **Human oversight**: Implement human oversight and review processes to detect and correct errors.\\n4. **Explainability and transparency**: Develop AI systems that provide clear explanations for their decisions.\\n5. **Accountability mechanisms**: Establish clear accountability mechanisms for errors or adverse outcomes.\\n6. **Cybersecurity measures**: Implement robust cybersecurity measures to protect AI systems and sensitive data.\\n7. **Ethics guidelines and regulations**: Develop and enforce ethics guidelines and regulations for AI development and deployment.\\n\\n**Best Practices:**\\n\\n1. **Multidisciplinary development teams**: Assemble teams with diverse expertise, including ethicists, to ensure that AI systems are developed with ethical considerations in mind.\\n2. **Inclusive and diverse testing**: Test AI systems with diverse datasets and user groups to identify and address potential biases.\\n3. **Continuous monitoring and evaluation**: Regularly monitor and evaluate AI systems for performance, safety, and ethical implications.\\n4. **Transparency and communication**: Communicate clearly with stakeholders about AI system capabilities, limitations, and potential risks.\\n5. **Ongoing education and training**: Provide ongoing education and training for developers, deployers, and users of AI systems to ensure they understand the ethical implications of AI decision-making.\\n\\nBy considering these factors and implementing mitigation strategies, we can develop AI systems that balance the potential benefits of autonomous decision-making with the need to address ethical concerns and minimize risks.\", \"Evaluating the ethical implications of developing autonomous AI for high-stakes decision-making requires a comprehensive and multi-disciplinary approach. Here's a framework to consider the potential benefits and risks, and balance them accordingly:\\n\\n**Potential Benefits:**\\n\\n1. Enhanced efficiency: Autonomous AI can process vast amounts of data quickly and accurately, leading to faster decision-making in high-stakes situations.\\n2. Improved accuracy: AI can reduce human error by analyzing objective data and making decisions based on evidence-based criteria.\\n3. Scalability: Autonomous AI can provide consistent results across multiple patients or scenarios, without the variability introduced by human factors.\\n\\n**Potential Risks:**\\n\\n1. **Bias:** AI systems can perpetuate pre-existing biases if they are trained using biased data or algorithms that replicate discriminatory patterns.\\n2. **Accountability:** As AI systems take on more decision-making authority, it becomes increasingly difficult to assign responsibility for errors or harm caused by those decisions.\\n3. **Unintended Consequences:** AI systems may produce unforeseen outcomes due to their inability to fully comprehend the complexity of human experience.\\n4. **Privacy and Security:** Autonomous AI in high-stakes situations can raise significant concerns regarding patient confidentiality, intellectual property protection, and data security.\\n\\n**Key Ethical Considerations:**\\n\\n1. **Value Alignment**: Ensure that AI systems align with core human values, such as compassion, dignity, and respect for autonomy.\\n2. **Transparency and Explainability**: Develop AI systems that provide transparent decision-making processes, allowing humans to understand the reasoning behind decisions.\\n3. **Equity and Fairness**: Implement measures to prevent bias in AI, ensuring fairness and equity across diverse populations.\\n4. **Human Oversight and Review**: Establish mechanisms for human review and intervention to ensure accountability and correct potential errors or biases.\\n5. **Responsible Development**: Foster a culture of responsible development, prioritizing safety, efficacy, and societal impact.\\n\\n**Recommendations:**\\n\\n1. Conduct thorough risk assessments and engage in open dialogue with stakeholders, including patients, healthcare professionals, and civil society representatives.\\n2. Establish independent review boards to monitor AI system development, deployment, and performance.\\n3. Develop comprehensive guidelines for data collection, processing, and storage, ensuring patient confidentiality and intellectual property protection.\\n4. Foster international collaboration on AI governance, regulatory frameworks, and best practices to address global concerns.\\n5. Invest in AI literacy initiatives to educate professionals and the general public about AI systems, their limitations, and potential risks.\\n\\nBy following this framework and engaging in ongoing dialogue with stakeholders, we can ensure that autonomous AI developments are guided by ethical principles, prioritizing human well-being, safety, and dignity.\"]\n"
     ]
    }
   ],
   "source": [
    "# So where are we?\n",
    "\n",
    "print(competitors)\n",
    "print(answers)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Competitor: gpt-4o-mini\n",
      "\n",
      "Evaluating the ethical implications of developing artificial intelligence (AI) that can autonomously make decisions in high-stakes situations requires a nuanced consideration of various factors, including potential benefits, risks, and the broader social context in which such technologies will operate. Here’s a structured approach to analyze these implications:\n",
      "\n",
      "### Potential Benefits:\n",
      "\n",
      "1. **Improved Efficiency**: AI systems can analyze vast amounts of data far more quickly than humans, potentially leading to faster decision-making in critical situations such as diagnosing diseases or responding to military threats.\n",
      "\n",
      "2. **Consistency**: AI can provide decisions based on established protocols without human fatigue or emotional bias, which may lead to more consistent outcomes in areas like healthcare treatment plans or frontline military tactics.\n",
      "\n",
      "3. **Enhanced Capabilities**: In some scenarios, AI can support human decision-making by providing predictive analytics, suggesting interventions, or identifying patterns that human decision-makers might miss.\n",
      "\n",
      "4. **Resource Optimization**: AI can help allocate medical or military resources more effectively, potentially leading to better outcomes in public health scenarios or military engagements.\n",
      "\n",
      "### Risks and Ethical Concerns:\n",
      "\n",
      "1. **Bias**: AI systems can inherit and amplify biases present in the data on which they are trained. This can lead to unfair treatment in healthcare (e.g., racial or socioeconomic disparities in treatment recommendations) or biased military strategies. Ensuring fairness and equity in AI decision-making is critical.\n",
      "\n",
      "2. **Accountability**: When AI makes decisions, it can be challenging to attribute responsibility for outcomes. This raises concerns about accountability—who is held responsible when an AI makes a mistake? Clarity in accountability structures is vitally important, especially in life-and-death situations.\n",
      "\n",
      "3. **Transparency**: The complexity of many AI algorithms, especially deep learning models, can hinder transparency. Stakeholders need to understand how decisions are made to trust and accept AI-driven outcomes.\n",
      "\n",
      "4. **Unintended Consequences**: AI systems might produce unforeseen outcomes, especially in dynamic environments. For instance, if an AI in a military context misinterprets a situation, it could lead to unintended escalations. This unpredictability necessitates rigorous testing and risk assessment.\n",
      "\n",
      "5. **Moral and Ethical Considerations**: Autonomous systems might struggle with nuanced moral judgments. For instance, in healthcare, decisions about end-of-life care can be deeply personal and context-dependent, raising questions about whether AI should play a role in such sensitive areas.\n",
      "\n",
      "### Balancing Benefits and Risks:\n",
      "\n",
      "1. **Regulatory Frameworks**: Establishing comprehensive regulations and ethical guidelines for AI development and deployment is necessary to govern accountability, transparency, and bias mitigation. Regulatory bodies must reflect diverse perspectives, including ethicists, domain experts, and community representatives.\n",
      "\n",
      "2. **Human Oversight**: Incorporating human-in-the-loop systems can help ensure that critical decisions still involve human judgment, especially when ethical considerations are at stake. This hybrid approach could allow for quicker decision-making while retaining accountability.\n",
      "\n",
      "3. **Bias Mitigation Strategies**: Actively working to identify, test, and mitigate biases in AI systems is essential. This includes diverse data collection, algorithmic transparency, and continuous monitoring of AI outputs.\n",
      "\n",
      "4. **Public Engagement**: Engaging with stakeholders—including the public, affected communities, and domain experts—can foster trust and ensure that AI systems are developed in alignment with societal values and needs.\n",
      "\n",
      "5. **Continuous Learning and Adaptation**: AI systems should be designed to learn from their environments and improve over time. This adaptability can help address unintended consequences and align more closely with ethical standards as they evolve.\n",
      "\n",
      "### Conclusion:\n",
      "\n",
      "Developing autonomous AI in high-stakes contexts is a double-edged sword that requires careful ethical scrutiny. While the potential benefits are substantial, they must be weighed against serious risks related to bias, accountability, transparency, and moral implications. A comprehensive approach that includes rigorous testing, regulatory frameworks, human oversight, and active public engagement can facilitate the responsible development of AI technologies that serve the best interests of society.\n",
      "\n",
      "\n",
      "Competitor: claude-3-7-sonnet-latest\n",
      "\n",
      "# Ethical Implications of Autonomous AI in High-Stakes Domains\n",
      "\n",
      "This is a complex ethical question that requires balancing several considerations:\n",
      "\n",
      "## Potential Benefits\n",
      "- Healthcare: AI could provide faster diagnoses, reach underserved populations, and detect patterns humans might miss\n",
      "- Military: Could reduce human casualties and potentially make more consistent decisions under pressure\n",
      "\n",
      "## Significant Concerns\n",
      "- **Accountability gap**: When AI makes harmful decisions, who bears responsibility - developers, deployers, or the system itself?\n",
      "- **Bias amplification**: AI systems trained on historical data may perpetuate or amplify existing societal biases\n",
      "- **Transparency challenges**: Complex AI systems often function as \"black boxes,\" making oversight difficult\n",
      "- **Value alignment**: Ensuring AI systems properly understand and implement human values and intentions\n",
      "\n",
      "## Balance Considerations\n",
      "- Proportional oversight: More autonomous systems in higher-stakes domains require more rigorous testing and human supervision\n",
      "- Explainability requirements may need to be stronger in contexts like healthcare than in other applications\n",
      "- The timeline for deployment should match our ability to solve safety and alignment challenges\n",
      "\n",
      "I believe thoughtful governance frameworks, inclusive development processes, and ongoing monitoring are essential to responsibly navigate these tradeoffs.\n",
      "\n",
      "\n",
      "Competitor: gemini-2.0-flash\n",
      "\n",
      "Evaluating the ethical implications of autonomous AI in high-stakes situations like healthcare and military applications is a complex undertaking. It requires careful consideration of potential benefits, risks, and the interplay of various ethical principles. Here's a structured approach:\n",
      "\n",
      "**1. Identifying Potential Benefits and Harms:**\n",
      "\n",
      "*   **Healthcare:**\n",
      "    *   **Benefits:**\n",
      "        *   Improved accuracy in diagnoses and treatment plans.\n",
      "        *   Increased access to healthcare, especially in underserved areas.\n",
      "        *   Reduced human error in complex procedures.\n",
      "        *   Faster response times in emergency situations.\n",
      "        *   Personalized medicine tailored to individual patient needs.\n",
      "    *   **Harms:**\n",
      "        *   Misdiagnosis or inappropriate treatment due to biased data or flawed algorithms.\n",
      "        *   Erosion of the doctor-patient relationship and loss of human empathy.\n",
      "        *   Privacy violations due to the collection and use of sensitive patient data.\n",
      "        *   Deskilling of medical professionals as they rely more on AI.\n",
      "        *   Exacerbation of existing health disparities if AI systems are trained on biased data.\n",
      "\n",
      "*   **Military Applications:**\n",
      "    *   **Benefits:**\n",
      "        *   Reduced casualties by removing soldiers from dangerous situations.\n",
      "        *   Improved precision in targeting and minimizing collateral damage.\n",
      "        *   Faster decision-making in combat situations.\n",
      "        *   Enhanced situational awareness through real-time data analysis.\n",
      "    *   **Harms:**\n",
      "        *   Unintended escalation of conflicts due to algorithmic errors.\n",
      "        *   Loss of human control over lethal force.\n",
      "        *   Dehumanization of warfare.\n",
      "        *   Increased risk of autonomous weapons falling into the wrong hands.\n",
      "        *   Lack of accountability for unintended consequences.\n",
      "\n",
      "**2. Addressing Ethical Principles:**\n",
      "\n",
      "*   **Autonomy and Human Control:**\n",
      "    *   How much control should humans retain over AI decisions?\n",
      "    *   Can AI systems be designed to respect human autonomy and values?\n",
      "    *   What safeguards can be implemented to prevent AI from exceeding its intended scope of authority?\n",
      "\n",
      "*   **Beneficence and Non-Maleficence (Do good and do no harm):**\n",
      "    *   How can we ensure that AI systems are designed to maximize benefits and minimize risks?\n",
      "    *   What measures can be taken to mitigate the potential for harm, such as bias, errors, and unintended consequences?\n",
      "    *   How do we balance the potential benefits against the risks, especially when lives are at stake?\n",
      "\n",
      "*   **Justice and Fairness:**\n",
      "    *   How can we ensure that AI systems are fair and equitable, and do not discriminate against certain groups?\n",
      "    *   How can we address the potential for bias in training data and algorithms?\n",
      "    *   How can we ensure that everyone has equal access to the benefits of AI, regardless of their socioeconomic status or background?\n",
      "\n",
      "*   **Accountability and Transparency:**\n",
      "    *   Who is responsible when an AI system makes a mistake or causes harm?\n",
      "    *   How can we ensure that AI systems are transparent and explainable, so that users can understand how they arrived at their decisions?\n",
      "    *   What mechanisms can be put in place to monitor and audit AI systems to ensure that they are performing as intended and are not causing unintended harm?\n",
      "\n",
      "*   **Privacy and Security:**\n",
      "    *   How can we protect the privacy and security of sensitive data used by AI systems?\n",
      "    *   What measures can be taken to prevent unauthorized access to or misuse of AI systems?\n",
      "    *   How can we ensure that AI systems comply with relevant data protection regulations?\n",
      "\n",
      "**3. Mitigating Risks:**\n",
      "\n",
      "*   **Bias Detection and Mitigation:** Implement rigorous testing and validation processes to identify and mitigate bias in training data and algorithms. Employ techniques such as data augmentation, fairness-aware algorithms, and adversarial debiasing.\n",
      "*   **Explainability and Interpretability:** Design AI systems that provide clear explanations for their decisions, allowing users to understand the reasoning behind the recommendations.  Use techniques like SHAP values, LIME, and attention mechanisms to highlight important features.\n",
      "*   **Robustness and Reliability:** Develop AI systems that are robust to noisy data, adversarial attacks, and unforeseen circumstances. Conduct thorough testing and validation to ensure that the systems perform reliably in real-world scenarios.\n",
      "*   **Human Oversight and Control:** Implement mechanisms for human oversight and control, allowing users to intervene and override AI decisions when necessary.  Design systems with clear escalation pathways for complex or uncertain situations.\n",
      "*   **Continuous Monitoring and Evaluation:**  Establish a system for continuous monitoring and evaluation of AI system performance, identifying and addressing any issues that arise over time.  Regularly audit the system for bias, accuracy, and fairness.\n",
      "*   **Ethical Guidelines and Regulations:** Develop clear ethical guidelines and regulations for the development and deployment of AI in high-stakes situations.  Promote responsible AI practices through education, training, and certification programs.\n",
      "\n",
      "**4. Frameworks and Tools:**\n",
      "\n",
      "*   **Ethical Impact Assessments (EIAs):**  Conduct EIAs before deploying AI systems to identify and mitigate potential ethical risks.\n",
      "*   **AI Ethics Toolkits:**  Utilize AI ethics toolkits and frameworks to guide the development and deployment of responsible AI systems.\n",
      "*   **Stakeholder Engagement:**  Involve a wide range of stakeholders, including experts, policymakers, and the public, in the development and deployment of AI systems.\n",
      "*   **Public Debate and Education:**  Promote public debate and education about the ethical implications of AI.\n",
      "\n",
      "**5.  Specific Considerations for Healthcare and Military:**\n",
      "\n",
      "*   **Healthcare:** Patient autonomy and the physician-patient relationship must be central.  Transparent algorithms are crucial for trust.  Regulations should protect patient data and prevent discrimination.\n",
      "*   **Military:** International humanitarian law must be strictly adhered to.  Human control over lethal force must be maintained. Clear lines of accountability are essential.\n",
      "\n",
      "**Conclusion:**\n",
      "\n",
      "Developing autonomous AI for high-stakes situations requires a comprehensive and ethical approach that prioritizes human well-being, fairness, and accountability. By carefully considering the potential benefits and risks, addressing ethical principles, and implementing appropriate safeguards, we can harness the power of AI while mitigating the risks of unintended consequences.  A proactive, multidisciplinary, and constantly evolving approach is necessary to navigate the complex ethical landscape of autonomous AI in these critical domains.\n",
      "\n",
      "\n",
      "\n",
      "Competitor: deepseek-chat\n",
      "\n",
      "The ethical implications of developing autonomous AI for high-stakes decision-making in fields like healthcare and military applications are profound and multifaceted. Below is a structured evaluation of the key considerations, balancing potential benefits against risks:\n",
      "\n",
      "### **Potential Benefits**  \n",
      "1. **Efficiency & Precision**  \n",
      "   - In healthcare, AI can diagnose diseases faster and more accurately than humans, improving patient outcomes (e.g., radiology AI detecting tumors).  \n",
      "   - In military contexts, autonomous systems could reduce human error in defensive operations.  \n",
      "\n",
      "2. **Scalability & Accessibility**  \n",
      "   - AI can provide expert-level decision-making in underserved regions where human specialists are scarce.  \n",
      "   - Autonomous drones could deliver medical supplies in conflict zones without risking human lives.  \n",
      "\n",
      "3. **Reduction of Human Risk**  \n",
      "   - In warfare, AI-driven systems could minimize soldier casualties by handling dangerous reconnaissance or defusing explosives.  \n",
      "\n",
      "### **Key Ethical Risks & Challenges**  \n",
      "1. **Bias & Fairness**  \n",
      "   - AI trained on biased data may perpetuate discrimination (e.g., underdiagnosing diseases in minority groups).  \n",
      "   - Military AI could misidentify targets based on flawed training data, leading to civilian harm.  \n",
      "\n",
      "2. **Accountability & Responsibility**  \n",
      "   - If an AI system makes a fatal error in surgery or warfare, who is liable? The developer, operator, or the AI itself?  \n",
      "   - Lack of clear legal frameworks complicates accountability.  \n",
      "\n",
      "3. **Unintended Consequences & Loss of Control**  \n",
      "   - Autonomous weapons could escalate conflicts unpredictably if hacked or misused.  \n",
      "   - Over-reliance on AI in healthcare might erode human judgment and patient trust.  \n",
      "\n",
      "4. **Transparency & Explainability**  \n",
      "   - Many AI systems (e.g., deep learning models) are \"black boxes,\" making it hard to justify decisions.  \n",
      "   - In life-or-death scenarios, the inability to explain AI reasoning is ethically problematic.  \n",
      "\n",
      "### **Balancing Benefits & Risks: Ethical Frameworks**  \n",
      "1. **Human-in-the-Loop (HITL) Oversight**  \n",
      "   - Critical decisions (e.g., lethal force in warfare, major surgeries) should require human confirmation.  \n",
      "   - Ensures accountability while leveraging AI’s efficiency.  \n",
      "\n",
      "2. **Robust Bias Mitigation & Auditing**  \n",
      "   - Diverse training datasets and continuous bias testing.  \n",
      "   - Independent oversight bodies to audit AI systems pre-deployment.  \n",
      "\n",
      "3. **International Regulations & Norms**  \n",
      "   - Bans or strict treaties on fully autonomous weapons (e.g., UN discussions on lethal autonomous weapons).  \n",
      "   - Ethical guidelines for medical AI (e.g., WHO’s principles on AI in health).  \n",
      "\n",
      "4. **Explainable AI (XAI) Development**  \n",
      "   - Prioritizing interpretable models in high-stakes fields to ensure decisions can be scrutinized.  \n",
      "\n",
      "### **Conclusion**  \n",
      "While autonomous AI offers transformative potential in healthcare and defense, its ethical risks demand rigorous safeguards. The balance hinges on **transparency, accountability, and human oversight**—ensuring AI augments rather than replaces human judgment in morally consequential domains. Without these guardrails, the risks of harm, bias, and loss of control could outweigh the benefits. Policymakers, technologists, and ethicists must collaborate to establish boundaries that maximize societal good while minimizing harm.\n",
      "\n",
      "\n",
      "Competitor: llama-3.3-70b-versatile\n",
      "\n",
      "Evaluating the ethical implications of developing artificial intelligence (AI) that can autonomously make decisions in high-stakes situations requires a comprehensive analysis of the potential benefits and risks. Here's a framework to consider:\n",
      "\n",
      "**Potential Benefits:**\n",
      "\n",
      "1. **Improved decision-making**: AI can process vast amounts of data, identify patterns, and make decisions faster and more accurately than humans in certain situations.\n",
      "2. **Enhanced efficiency**: AI can automate routine tasks, freeing up human resources for more complex and high-value tasks.\n",
      "3. **Increased accessibility**: AI can provide decision-making support in areas where human expertise is scarce or unavailable.\n",
      "4. **Personalized care**: AI can help tailor healthcare decisions to individual patients' needs, leading to better outcomes.\n",
      "\n",
      "**Risks and Concerns:**\n",
      "\n",
      "1. **Bias and discrimination**: AI systems can perpetuate and amplify existing biases if trained on biased data, leading to unfair outcomes.\n",
      "2. **Lack of accountability**: As AI systems make autonomous decisions, it can be challenging to determine responsibility for errors or adverse outcomes.\n",
      "3. **Unintended consequences**: AI systems can produce unintended consequences, such as unforeseen side effects or interactions with other systems.\n",
      "4. **Cybersecurity risks**: AI systems can be vulnerable to cyber attacks, compromising sensitive data and decision-making processes.\n",
      "5. **Transparency and explainability**: AI systems can be difficult to interpret, making it challenging to understand the reasoning behind their decisions.\n",
      "\n",
      "**Ethical Considerations:**\n",
      "\n",
      "1. **Respect for autonomy**: AI systems should be designed to respect human autonomy and decision-making capacity.\n",
      "2. **Non-maleficence**: AI systems should be designed to minimize harm and avoid causing unnecessary harm.\n",
      "3. **Beneficence**: AI systems should be designed to promote the well-being and best interests of individuals and society.\n",
      "4. **Justice**: AI systems should be designed to ensure fairness, equity, and distributive justice.\n",
      "\n",
      "**Mitigation Strategies:**\n",
      "\n",
      "1. **Data curation**: Ensure that training data is diverse, representative, and free from bias.\n",
      "2. **Algorithmic auditing**: Regularly audit AI systems for bias and errors.\n",
      "3. **Human oversight**: Implement human oversight and review processes to detect and correct errors.\n",
      "4. **Explainability and transparency**: Develop AI systems that provide clear explanations for their decisions.\n",
      "5. **Accountability mechanisms**: Establish clear accountability mechanisms for errors or adverse outcomes.\n",
      "6. **Cybersecurity measures**: Implement robust cybersecurity measures to protect AI systems and sensitive data.\n",
      "7. **Ethics guidelines and regulations**: Develop and enforce ethics guidelines and regulations for AI development and deployment.\n",
      "\n",
      "**Best Practices:**\n",
      "\n",
      "1. **Multidisciplinary development teams**: Assemble teams with diverse expertise, including ethicists, to ensure that AI systems are developed with ethical considerations in mind.\n",
      "2. **Inclusive and diverse testing**: Test AI systems with diverse datasets and user groups to identify and address potential biases.\n",
      "3. **Continuous monitoring and evaluation**: Regularly monitor and evaluate AI systems for performance, safety, and ethical implications.\n",
      "4. **Transparency and communication**: Communicate clearly with stakeholders about AI system capabilities, limitations, and potential risks.\n",
      "5. **Ongoing education and training**: Provide ongoing education and training for developers, deployers, and users of AI systems to ensure they understand the ethical implications of AI decision-making.\n",
      "\n",
      "By considering these factors and implementing mitigation strategies, we can develop AI systems that balance the potential benefits of autonomous decision-making with the need to address ethical concerns and minimize risks.\n",
      "\n",
      "\n",
      "Competitor: llama3.2:latest\n",
      "\n",
      "Evaluating the ethical implications of developing autonomous AI for high-stakes decision-making requires a comprehensive and multi-disciplinary approach. Here's a framework to consider the potential benefits and risks, and balance them accordingly:\n",
      "\n",
      "**Potential Benefits:**\n",
      "\n",
      "1. Enhanced efficiency: Autonomous AI can process vast amounts of data quickly and accurately, leading to faster decision-making in high-stakes situations.\n",
      "2. Improved accuracy: AI can reduce human error by analyzing objective data and making decisions based on evidence-based criteria.\n",
      "3. Scalability: Autonomous AI can provide consistent results across multiple patients or scenarios, without the variability introduced by human factors.\n",
      "\n",
      "**Potential Risks:**\n",
      "\n",
      "1. **Bias:** AI systems can perpetuate pre-existing biases if they are trained using biased data or algorithms that replicate discriminatory patterns.\n",
      "2. **Accountability:** As AI systems take on more decision-making authority, it becomes increasingly difficult to assign responsibility for errors or harm caused by those decisions.\n",
      "3. **Unintended Consequences:** AI systems may produce unforeseen outcomes due to their inability to fully comprehend the complexity of human experience.\n",
      "4. **Privacy and Security:** Autonomous AI in high-stakes situations can raise significant concerns regarding patient confidentiality, intellectual property protection, and data security.\n",
      "\n",
      "**Key Ethical Considerations:**\n",
      "\n",
      "1. **Value Alignment**: Ensure that AI systems align with core human values, such as compassion, dignity, and respect for autonomy.\n",
      "2. **Transparency and Explainability**: Develop AI systems that provide transparent decision-making processes, allowing humans to understand the reasoning behind decisions.\n",
      "3. **Equity and Fairness**: Implement measures to prevent bias in AI, ensuring fairness and equity across diverse populations.\n",
      "4. **Human Oversight and Review**: Establish mechanisms for human review and intervention to ensure accountability and correct potential errors or biases.\n",
      "5. **Responsible Development**: Foster a culture of responsible development, prioritizing safety, efficacy, and societal impact.\n",
      "\n",
      "**Recommendations:**\n",
      "\n",
      "1. Conduct thorough risk assessments and engage in open dialogue with stakeholders, including patients, healthcare professionals, and civil society representatives.\n",
      "2. Establish independent review boards to monitor AI system development, deployment, and performance.\n",
      "3. Develop comprehensive guidelines for data collection, processing, and storage, ensuring patient confidentiality and intellectual property protection.\n",
      "4. Foster international collaboration on AI governance, regulatory frameworks, and best practices to address global concerns.\n",
      "5. Invest in AI literacy initiatives to educate professionals and the general public about AI systems, their limitations, and potential risks.\n",
      "\n",
      "By following this framework and engaging in ongoing dialogue with stakeholders, we can ensure that autonomous AI developments are guided by ethical principles, prioritizing human well-being, safety, and dignity.\n",
      "\n",
      "\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\\n\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "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": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "# Response from competitor 1\n",
      "\n",
      "Evaluating the ethical implications of developing artificial intelligence (AI) that can autonomously make decisions in high-stakes situations requires a nuanced consideration of various factors, including potential benefits, risks, and the broader social context in which such technologies will operate. Here’s a structured approach to analyze these implications:\n",
      "\n",
      "### Potential Benefits:\n",
      "\n",
      "1. **Improved Efficiency**: AI systems can analyze vast amounts of data far more quickly than humans, potentially leading to faster decision-making in critical situations such as diagnosing diseases or responding to military threats.\n",
      "\n",
      "2. **Consistency**: AI can provide decisions based on established protocols without human fatigue or emotional bias, which may lead to more consistent outcomes in areas like healthcare treatment plans or frontline military tactics.\n",
      "\n",
      "3. **Enhanced Capabilities**: In some scenarios, AI can support human decision-making by providing predictive analytics, suggesting interventions, or identifying patterns that human decision-makers might miss.\n",
      "\n",
      "4. **Resource Optimization**: AI can help allocate medical or military resources more effectively, potentially leading to better outcomes in public health scenarios or military engagements.\n",
      "\n",
      "### Risks and Ethical Concerns:\n",
      "\n",
      "1. **Bias**: AI systems can inherit and amplify biases present in the data on which they are trained. This can lead to unfair treatment in healthcare (e.g., racial or socioeconomic disparities in treatment recommendations) or biased military strategies. Ensuring fairness and equity in AI decision-making is critical.\n",
      "\n",
      "2. **Accountability**: When AI makes decisions, it can be challenging to attribute responsibility for outcomes. This raises concerns about accountability—who is held responsible when an AI makes a mistake? Clarity in accountability structures is vitally important, especially in life-and-death situations.\n",
      "\n",
      "3. **Transparency**: The complexity of many AI algorithms, especially deep learning models, can hinder transparency. Stakeholders need to understand how decisions are made to trust and accept AI-driven outcomes.\n",
      "\n",
      "4. **Unintended Consequences**: AI systems might produce unforeseen outcomes, especially in dynamic environments. For instance, if an AI in a military context misinterprets a situation, it could lead to unintended escalations. This unpredictability necessitates rigorous testing and risk assessment.\n",
      "\n",
      "5. **Moral and Ethical Considerations**: Autonomous systems might struggle with nuanced moral judgments. For instance, in healthcare, decisions about end-of-life care can be deeply personal and context-dependent, raising questions about whether AI should play a role in such sensitive areas.\n",
      "\n",
      "### Balancing Benefits and Risks:\n",
      "\n",
      "1. **Regulatory Frameworks**: Establishing comprehensive regulations and ethical guidelines for AI development and deployment is necessary to govern accountability, transparency, and bias mitigation. Regulatory bodies must reflect diverse perspectives, including ethicists, domain experts, and community representatives.\n",
      "\n",
      "2. **Human Oversight**: Incorporating human-in-the-loop systems can help ensure that critical decisions still involve human judgment, especially when ethical considerations are at stake. This hybrid approach could allow for quicker decision-making while retaining accountability.\n",
      "\n",
      "3. **Bias Mitigation Strategies**: Actively working to identify, test, and mitigate biases in AI systems is essential. This includes diverse data collection, algorithmic transparency, and continuous monitoring of AI outputs.\n",
      "\n",
      "4. **Public Engagement**: Engaging with stakeholders—including the public, affected communities, and domain experts—can foster trust and ensure that AI systems are developed in alignment with societal values and needs.\n",
      "\n",
      "5. **Continuous Learning and Adaptation**: AI systems should be designed to learn from their environments and improve over time. This adaptability can help address unintended consequences and align more closely with ethical standards as they evolve.\n",
      "\n",
      "### Conclusion:\n",
      "\n",
      "Developing autonomous AI in high-stakes contexts is a double-edged sword that requires careful ethical scrutiny. While the potential benefits are substantial, they must be weighed against serious risks related to bias, accountability, transparency, and moral implications. A comprehensive approach that includes rigorous testing, regulatory frameworks, human oversight, and active public engagement can facilitate the responsible development of AI technologies that serve the best interests of society.\n",
      "\n",
      "# Response from competitor 2\n",
      "\n",
      "# Ethical Implications of Autonomous AI in High-Stakes Domains\n",
      "\n",
      "This is a complex ethical question that requires balancing several considerations:\n",
      "\n",
      "## Potential Benefits\n",
      "- Healthcare: AI could provide faster diagnoses, reach underserved populations, and detect patterns humans might miss\n",
      "- Military: Could reduce human casualties and potentially make more consistent decisions under pressure\n",
      "\n",
      "## Significant Concerns\n",
      "- **Accountability gap**: When AI makes harmful decisions, who bears responsibility - developers, deployers, or the system itself?\n",
      "- **Bias amplification**: AI systems trained on historical data may perpetuate or amplify existing societal biases\n",
      "- **Transparency challenges**: Complex AI systems often function as \"black boxes,\" making oversight difficult\n",
      "- **Value alignment**: Ensuring AI systems properly understand and implement human values and intentions\n",
      "\n",
      "## Balance Considerations\n",
      "- Proportional oversight: More autonomous systems in higher-stakes domains require more rigorous testing and human supervision\n",
      "- Explainability requirements may need to be stronger in contexts like healthcare than in other applications\n",
      "- The timeline for deployment should match our ability to solve safety and alignment challenges\n",
      "\n",
      "I believe thoughtful governance frameworks, inclusive development processes, and ongoing monitoring are essential to responsibly navigate these tradeoffs.\n",
      "\n",
      "# Response from competitor 3\n",
      "\n",
      "Evaluating the ethical implications of autonomous AI in high-stakes situations like healthcare and military applications is a complex undertaking. It requires careful consideration of potential benefits, risks, and the interplay of various ethical principles. Here's a structured approach:\n",
      "\n",
      "**1. Identifying Potential Benefits and Harms:**\n",
      "\n",
      "*   **Healthcare:**\n",
      "    *   **Benefits:**\n",
      "        *   Improved accuracy in diagnoses and treatment plans.\n",
      "        *   Increased access to healthcare, especially in underserved areas.\n",
      "        *   Reduced human error in complex procedures.\n",
      "        *   Faster response times in emergency situations.\n",
      "        *   Personalized medicine tailored to individual patient needs.\n",
      "    *   **Harms:**\n",
      "        *   Misdiagnosis or inappropriate treatment due to biased data or flawed algorithms.\n",
      "        *   Erosion of the doctor-patient relationship and loss of human empathy.\n",
      "        *   Privacy violations due to the collection and use of sensitive patient data.\n",
      "        *   Deskilling of medical professionals as they rely more on AI.\n",
      "        *   Exacerbation of existing health disparities if AI systems are trained on biased data.\n",
      "\n",
      "*   **Military Applications:**\n",
      "    *   **Benefits:**\n",
      "        *   Reduced casualties by removing soldiers from dangerous situations.\n",
      "        *   Improved precision in targeting and minimizing collateral damage.\n",
      "        *   Faster decision-making in combat situations.\n",
      "        *   Enhanced situational awareness through real-time data analysis.\n",
      "    *   **Harms:**\n",
      "        *   Unintended escalation of conflicts due to algorithmic errors.\n",
      "        *   Loss of human control over lethal force.\n",
      "        *   Dehumanization of warfare.\n",
      "        *   Increased risk of autonomous weapons falling into the wrong hands.\n",
      "        *   Lack of accountability for unintended consequences.\n",
      "\n",
      "**2. Addressing Ethical Principles:**\n",
      "\n",
      "*   **Autonomy and Human Control:**\n",
      "    *   How much control should humans retain over AI decisions?\n",
      "    *   Can AI systems be designed to respect human autonomy and values?\n",
      "    *   What safeguards can be implemented to prevent AI from exceeding its intended scope of authority?\n",
      "\n",
      "*   **Beneficence and Non-Maleficence (Do good and do no harm):**\n",
      "    *   How can we ensure that AI systems are designed to maximize benefits and minimize risks?\n",
      "    *   What measures can be taken to mitigate the potential for harm, such as bias, errors, and unintended consequences?\n",
      "    *   How do we balance the potential benefits against the risks, especially when lives are at stake?\n",
      "\n",
      "*   **Justice and Fairness:**\n",
      "    *   How can we ensure that AI systems are fair and equitable, and do not discriminate against certain groups?\n",
      "    *   How can we address the potential for bias in training data and algorithms?\n",
      "    *   How can we ensure that everyone has equal access to the benefits of AI, regardless of their socioeconomic status or background?\n",
      "\n",
      "*   **Accountability and Transparency:**\n",
      "    *   Who is responsible when an AI system makes a mistake or causes harm?\n",
      "    *   How can we ensure that AI systems are transparent and explainable, so that users can understand how they arrived at their decisions?\n",
      "    *   What mechanisms can be put in place to monitor and audit AI systems to ensure that they are performing as intended and are not causing unintended harm?\n",
      "\n",
      "*   **Privacy and Security:**\n",
      "    *   How can we protect the privacy and security of sensitive data used by AI systems?\n",
      "    *   What measures can be taken to prevent unauthorized access to or misuse of AI systems?\n",
      "    *   How can we ensure that AI systems comply with relevant data protection regulations?\n",
      "\n",
      "**3. Mitigating Risks:**\n",
      "\n",
      "*   **Bias Detection and Mitigation:** Implement rigorous testing and validation processes to identify and mitigate bias in training data and algorithms. Employ techniques such as data augmentation, fairness-aware algorithms, and adversarial debiasing.\n",
      "*   **Explainability and Interpretability:** Design AI systems that provide clear explanations for their decisions, allowing users to understand the reasoning behind the recommendations.  Use techniques like SHAP values, LIME, and attention mechanisms to highlight important features.\n",
      "*   **Robustness and Reliability:** Develop AI systems that are robust to noisy data, adversarial attacks, and unforeseen circumstances. Conduct thorough testing and validation to ensure that the systems perform reliably in real-world scenarios.\n",
      "*   **Human Oversight and Control:** Implement mechanisms for human oversight and control, allowing users to intervene and override AI decisions when necessary.  Design systems with clear escalation pathways for complex or uncertain situations.\n",
      "*   **Continuous Monitoring and Evaluation:**  Establish a system for continuous monitoring and evaluation of AI system performance, identifying and addressing any issues that arise over time.  Regularly audit the system for bias, accuracy, and fairness.\n",
      "*   **Ethical Guidelines and Regulations:** Develop clear ethical guidelines and regulations for the development and deployment of AI in high-stakes situations.  Promote responsible AI practices through education, training, and certification programs.\n",
      "\n",
      "**4. Frameworks and Tools:**\n",
      "\n",
      "*   **Ethical Impact Assessments (EIAs):**  Conduct EIAs before deploying AI systems to identify and mitigate potential ethical risks.\n",
      "*   **AI Ethics Toolkits:**  Utilize AI ethics toolkits and frameworks to guide the development and deployment of responsible AI systems.\n",
      "*   **Stakeholder Engagement:**  Involve a wide range of stakeholders, including experts, policymakers, and the public, in the development and deployment of AI systems.\n",
      "*   **Public Debate and Education:**  Promote public debate and education about the ethical implications of AI.\n",
      "\n",
      "**5.  Specific Considerations for Healthcare and Military:**\n",
      "\n",
      "*   **Healthcare:** Patient autonomy and the physician-patient relationship must be central.  Transparent algorithms are crucial for trust.  Regulations should protect patient data and prevent discrimination.\n",
      "*   **Military:** International humanitarian law must be strictly adhered to.  Human control over lethal force must be maintained. Clear lines of accountability are essential.\n",
      "\n",
      "**Conclusion:**\n",
      "\n",
      "Developing autonomous AI for high-stakes situations requires a comprehensive and ethical approach that prioritizes human well-being, fairness, and accountability. By carefully considering the potential benefits and risks, addressing ethical principles, and implementing appropriate safeguards, we can harness the power of AI while mitigating the risks of unintended consequences.  A proactive, multidisciplinary, and constantly evolving approach is necessary to navigate the complex ethical landscape of autonomous AI in these critical domains.\n",
      "\n",
      "\n",
      "# Response from competitor 4\n",
      "\n",
      "The ethical implications of developing autonomous AI for high-stakes decision-making in fields like healthcare and military applications are profound and multifaceted. Below is a structured evaluation of the key considerations, balancing potential benefits against risks:\n",
      "\n",
      "### **Potential Benefits**  \n",
      "1. **Efficiency & Precision**  \n",
      "   - In healthcare, AI can diagnose diseases faster and more accurately than humans, improving patient outcomes (e.g., radiology AI detecting tumors).  \n",
      "   - In military contexts, autonomous systems could reduce human error in defensive operations.  \n",
      "\n",
      "2. **Scalability & Accessibility**  \n",
      "   - AI can provide expert-level decision-making in underserved regions where human specialists are scarce.  \n",
      "   - Autonomous drones could deliver medical supplies in conflict zones without risking human lives.  \n",
      "\n",
      "3. **Reduction of Human Risk**  \n",
      "   - In warfare, AI-driven systems could minimize soldier casualties by handling dangerous reconnaissance or defusing explosives.  \n",
      "\n",
      "### **Key Ethical Risks & Challenges**  \n",
      "1. **Bias & Fairness**  \n",
      "   - AI trained on biased data may perpetuate discrimination (e.g., underdiagnosing diseases in minority groups).  \n",
      "   - Military AI could misidentify targets based on flawed training data, leading to civilian harm.  \n",
      "\n",
      "2. **Accountability & Responsibility**  \n",
      "   - If an AI system makes a fatal error in surgery or warfare, who is liable? The developer, operator, or the AI itself?  \n",
      "   - Lack of clear legal frameworks complicates accountability.  \n",
      "\n",
      "3. **Unintended Consequences & Loss of Control**  \n",
      "   - Autonomous weapons could escalate conflicts unpredictably if hacked or misused.  \n",
      "   - Over-reliance on AI in healthcare might erode human judgment and patient trust.  \n",
      "\n",
      "4. **Transparency & Explainability**  \n",
      "   - Many AI systems (e.g., deep learning models) are \"black boxes,\" making it hard to justify decisions.  \n",
      "   - In life-or-death scenarios, the inability to explain AI reasoning is ethically problematic.  \n",
      "\n",
      "### **Balancing Benefits & Risks: Ethical Frameworks**  \n",
      "1. **Human-in-the-Loop (HITL) Oversight**  \n",
      "   - Critical decisions (e.g., lethal force in warfare, major surgeries) should require human confirmation.  \n",
      "   - Ensures accountability while leveraging AI’s efficiency.  \n",
      "\n",
      "2. **Robust Bias Mitigation & Auditing**  \n",
      "   - Diverse training datasets and continuous bias testing.  \n",
      "   - Independent oversight bodies to audit AI systems pre-deployment.  \n",
      "\n",
      "3. **International Regulations & Norms**  \n",
      "   - Bans or strict treaties on fully autonomous weapons (e.g., UN discussions on lethal autonomous weapons).  \n",
      "   - Ethical guidelines for medical AI (e.g., WHO’s principles on AI in health).  \n",
      "\n",
      "4. **Explainable AI (XAI) Development**  \n",
      "   - Prioritizing interpretable models in high-stakes fields to ensure decisions can be scrutinized.  \n",
      "\n",
      "### **Conclusion**  \n",
      "While autonomous AI offers transformative potential in healthcare and defense, its ethical risks demand rigorous safeguards. The balance hinges on **transparency, accountability, and human oversight**—ensuring AI augments rather than replaces human judgment in morally consequential domains. Without these guardrails, the risks of harm, bias, and loss of control could outweigh the benefits. Policymakers, technologists, and ethicists must collaborate to establish boundaries that maximize societal good while minimizing harm.\n",
      "\n",
      "# Response from competitor 5\n",
      "\n",
      "Evaluating the ethical implications of developing artificial intelligence (AI) that can autonomously make decisions in high-stakes situations requires a comprehensive analysis of the potential benefits and risks. Here's a framework to consider:\n",
      "\n",
      "**Potential Benefits:**\n",
      "\n",
      "1. **Improved decision-making**: AI can process vast amounts of data, identify patterns, and make decisions faster and more accurately than humans in certain situations.\n",
      "2. **Enhanced efficiency**: AI can automate routine tasks, freeing up human resources for more complex and high-value tasks.\n",
      "3. **Increased accessibility**: AI can provide decision-making support in areas where human expertise is scarce or unavailable.\n",
      "4. **Personalized care**: AI can help tailor healthcare decisions to individual patients' needs, leading to better outcomes.\n",
      "\n",
      "**Risks and Concerns:**\n",
      "\n",
      "1. **Bias and discrimination**: AI systems can perpetuate and amplify existing biases if trained on biased data, leading to unfair outcomes.\n",
      "2. **Lack of accountability**: As AI systems make autonomous decisions, it can be challenging to determine responsibility for errors or adverse outcomes.\n",
      "3. **Unintended consequences**: AI systems can produce unintended consequences, such as unforeseen side effects or interactions with other systems.\n",
      "4. **Cybersecurity risks**: AI systems can be vulnerable to cyber attacks, compromising sensitive data and decision-making processes.\n",
      "5. **Transparency and explainability**: AI systems can be difficult to interpret, making it challenging to understand the reasoning behind their decisions.\n",
      "\n",
      "**Ethical Considerations:**\n",
      "\n",
      "1. **Respect for autonomy**: AI systems should be designed to respect human autonomy and decision-making capacity.\n",
      "2. **Non-maleficence**: AI systems should be designed to minimize harm and avoid causing unnecessary harm.\n",
      "3. **Beneficence**: AI systems should be designed to promote the well-being and best interests of individuals and society.\n",
      "4. **Justice**: AI systems should be designed to ensure fairness, equity, and distributive justice.\n",
      "\n",
      "**Mitigation Strategies:**\n",
      "\n",
      "1. **Data curation**: Ensure that training data is diverse, representative, and free from bias.\n",
      "2. **Algorithmic auditing**: Regularly audit AI systems for bias and errors.\n",
      "3. **Human oversight**: Implement human oversight and review processes to detect and correct errors.\n",
      "4. **Explainability and transparency**: Develop AI systems that provide clear explanations for their decisions.\n",
      "5. **Accountability mechanisms**: Establish clear accountability mechanisms for errors or adverse outcomes.\n",
      "6. **Cybersecurity measures**: Implement robust cybersecurity measures to protect AI systems and sensitive data.\n",
      "7. **Ethics guidelines and regulations**: Develop and enforce ethics guidelines and regulations for AI development and deployment.\n",
      "\n",
      "**Best Practices:**\n",
      "\n",
      "1. **Multidisciplinary development teams**: Assemble teams with diverse expertise, including ethicists, to ensure that AI systems are developed with ethical considerations in mind.\n",
      "2. **Inclusive and diverse testing**: Test AI systems with diverse datasets and user groups to identify and address potential biases.\n",
      "3. **Continuous monitoring and evaluation**: Regularly monitor and evaluate AI systems for performance, safety, and ethical implications.\n",
      "4. **Transparency and communication**: Communicate clearly with stakeholders about AI system capabilities, limitations, and potential risks.\n",
      "5. **Ongoing education and training**: Provide ongoing education and training for developers, deployers, and users of AI systems to ensure they understand the ethical implications of AI decision-making.\n",
      "\n",
      "By considering these factors and implementing mitigation strategies, we can develop AI systems that balance the potential benefits of autonomous decision-making with the need to address ethical concerns and minimize risks.\n",
      "\n",
      "# Response from competitor 6\n",
      "\n",
      "Evaluating the ethical implications of developing autonomous AI for high-stakes decision-making requires a comprehensive and multi-disciplinary approach. Here's a framework to consider the potential benefits and risks, and balance them accordingly:\n",
      "\n",
      "**Potential Benefits:**\n",
      "\n",
      "1. Enhanced efficiency: Autonomous AI can process vast amounts of data quickly and accurately, leading to faster decision-making in high-stakes situations.\n",
      "2. Improved accuracy: AI can reduce human error by analyzing objective data and making decisions based on evidence-based criteria.\n",
      "3. Scalability: Autonomous AI can provide consistent results across multiple patients or scenarios, without the variability introduced by human factors.\n",
      "\n",
      "**Potential Risks:**\n",
      "\n",
      "1. **Bias:** AI systems can perpetuate pre-existing biases if they are trained using biased data or algorithms that replicate discriminatory patterns.\n",
      "2. **Accountability:** As AI systems take on more decision-making authority, it becomes increasingly difficult to assign responsibility for errors or harm caused by those decisions.\n",
      "3. **Unintended Consequences:** AI systems may produce unforeseen outcomes due to their inability to fully comprehend the complexity of human experience.\n",
      "4. **Privacy and Security:** Autonomous AI in high-stakes situations can raise significant concerns regarding patient confidentiality, intellectual property protection, and data security.\n",
      "\n",
      "**Key Ethical Considerations:**\n",
      "\n",
      "1. **Value Alignment**: Ensure that AI systems align with core human values, such as compassion, dignity, and respect for autonomy.\n",
      "2. **Transparency and Explainability**: Develop AI systems that provide transparent decision-making processes, allowing humans to understand the reasoning behind decisions.\n",
      "3. **Equity and Fairness**: Implement measures to prevent bias in AI, ensuring fairness and equity across diverse populations.\n",
      "4. **Human Oversight and Review**: Establish mechanisms for human review and intervention to ensure accountability and correct potential errors or biases.\n",
      "5. **Responsible Development**: Foster a culture of responsible development, prioritizing safety, efficacy, and societal impact.\n",
      "\n",
      "**Recommendations:**\n",
      "\n",
      "1. Conduct thorough risk assessments and engage in open dialogue with stakeholders, including patients, healthcare professionals, and civil society representatives.\n",
      "2. Establish independent review boards to monitor AI system development, deployment, and performance.\n",
      "3. Develop comprehensive guidelines for data collection, processing, and storage, ensuring patient confidentiality and intellectual property protection.\n",
      "4. Foster international collaboration on AI governance, regulatory frameworks, and best practices to address global concerns.\n",
      "5. Invest in AI literacy initiatives to educate professionals and the general public about AI systems, their limitations, and potential risks.\n",
      "\n",
      "By following this framework and engaging in ongoing dialogue with stakeholders, we can ensure that autonomous AI developments are guided by ethical principles, prioritizing human well-being, safety, and dignity.\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(together)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "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": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You are judging a competition between 6 competitors.\n",
      "Each model has been given this question:\n",
      "\n",
      "How would you evaluate the ethical implications of developing artificial intelligence that can autonomously make decisions in high-stakes situations, such as in healthcare or military applications, balancing the potential benefits against the risks of bias, accountability, and unintended consequences?\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",
      "Evaluating the ethical implications of developing artificial intelligence (AI) that can autonomously make decisions in high-stakes situations requires a nuanced consideration of various factors, including potential benefits, risks, and the broader social context in which such technologies will operate. Here’s a structured approach to analyze these implications:\n",
      "\n",
      "### Potential Benefits:\n",
      "\n",
      "1. **Improved Efficiency**: AI systems can analyze vast amounts of data far more quickly than humans, potentially leading to faster decision-making in critical situations such as diagnosing diseases or responding to military threats.\n",
      "\n",
      "2. **Consistency**: AI can provide decisions based on established protocols without human fatigue or emotional bias, which may lead to more consistent outcomes in areas like healthcare treatment plans or frontline military tactics.\n",
      "\n",
      "3. **Enhanced Capabilities**: In some scenarios, AI can support human decision-making by providing predictive analytics, suggesting interventions, or identifying patterns that human decision-makers might miss.\n",
      "\n",
      "4. **Resource Optimization**: AI can help allocate medical or military resources more effectively, potentially leading to better outcomes in public health scenarios or military engagements.\n",
      "\n",
      "### Risks and Ethical Concerns:\n",
      "\n",
      "1. **Bias**: AI systems can inherit and amplify biases present in the data on which they are trained. This can lead to unfair treatment in healthcare (e.g., racial or socioeconomic disparities in treatment recommendations) or biased military strategies. Ensuring fairness and equity in AI decision-making is critical.\n",
      "\n",
      "2. **Accountability**: When AI makes decisions, it can be challenging to attribute responsibility for outcomes. This raises concerns about accountability—who is held responsible when an AI makes a mistake? Clarity in accountability structures is vitally important, especially in life-and-death situations.\n",
      "\n",
      "3. **Transparency**: The complexity of many AI algorithms, especially deep learning models, can hinder transparency. Stakeholders need to understand how decisions are made to trust and accept AI-driven outcomes.\n",
      "\n",
      "4. **Unintended Consequences**: AI systems might produce unforeseen outcomes, especially in dynamic environments. For instance, if an AI in a military context misinterprets a situation, it could lead to unintended escalations. This unpredictability necessitates rigorous testing and risk assessment.\n",
      "\n",
      "5. **Moral and Ethical Considerations**: Autonomous systems might struggle with nuanced moral judgments. For instance, in healthcare, decisions about end-of-life care can be deeply personal and context-dependent, raising questions about whether AI should play a role in such sensitive areas.\n",
      "\n",
      "### Balancing Benefits and Risks:\n",
      "\n",
      "1. **Regulatory Frameworks**: Establishing comprehensive regulations and ethical guidelines for AI development and deployment is necessary to govern accountability, transparency, and bias mitigation. Regulatory bodies must reflect diverse perspectives, including ethicists, domain experts, and community representatives.\n",
      "\n",
      "2. **Human Oversight**: Incorporating human-in-the-loop systems can help ensure that critical decisions still involve human judgment, especially when ethical considerations are at stake. This hybrid approach could allow for quicker decision-making while retaining accountability.\n",
      "\n",
      "3. **Bias Mitigation Strategies**: Actively working to identify, test, and mitigate biases in AI systems is essential. This includes diverse data collection, algorithmic transparency, and continuous monitoring of AI outputs.\n",
      "\n",
      "4. **Public Engagement**: Engaging with stakeholders—including the public, affected communities, and domain experts—can foster trust and ensure that AI systems are developed in alignment with societal values and needs.\n",
      "\n",
      "5. **Continuous Learning and Adaptation**: AI systems should be designed to learn from their environments and improve over time. This adaptability can help address unintended consequences and align more closely with ethical standards as they evolve.\n",
      "\n",
      "### Conclusion:\n",
      "\n",
      "Developing autonomous AI in high-stakes contexts is a double-edged sword that requires careful ethical scrutiny. While the potential benefits are substantial, they must be weighed against serious risks related to bias, accountability, transparency, and moral implications. A comprehensive approach that includes rigorous testing, regulatory frameworks, human oversight, and active public engagement can facilitate the responsible development of AI technologies that serve the best interests of society.\n",
      "\n",
      "# Response from competitor 2\n",
      "\n",
      "# Ethical Implications of Autonomous AI in High-Stakes Domains\n",
      "\n",
      "This is a complex ethical question that requires balancing several considerations:\n",
      "\n",
      "## Potential Benefits\n",
      "- Healthcare: AI could provide faster diagnoses, reach underserved populations, and detect patterns humans might miss\n",
      "- Military: Could reduce human casualties and potentially make more consistent decisions under pressure\n",
      "\n",
      "## Significant Concerns\n",
      "- **Accountability gap**: When AI makes harmful decisions, who bears responsibility - developers, deployers, or the system itself?\n",
      "- **Bias amplification**: AI systems trained on historical data may perpetuate or amplify existing societal biases\n",
      "- **Transparency challenges**: Complex AI systems often function as \"black boxes,\" making oversight difficult\n",
      "- **Value alignment**: Ensuring AI systems properly understand and implement human values and intentions\n",
      "\n",
      "## Balance Considerations\n",
      "- Proportional oversight: More autonomous systems in higher-stakes domains require more rigorous testing and human supervision\n",
      "- Explainability requirements may need to be stronger in contexts like healthcare than in other applications\n",
      "- The timeline for deployment should match our ability to solve safety and alignment challenges\n",
      "\n",
      "I believe thoughtful governance frameworks, inclusive development processes, and ongoing monitoring are essential to responsibly navigate these tradeoffs.\n",
      "\n",
      "# Response from competitor 3\n",
      "\n",
      "Evaluating the ethical implications of autonomous AI in high-stakes situations like healthcare and military applications is a complex undertaking. It requires careful consideration of potential benefits, risks, and the interplay of various ethical principles. Here's a structured approach:\n",
      "\n",
      "**1. Identifying Potential Benefits and Harms:**\n",
      "\n",
      "*   **Healthcare:**\n",
      "    *   **Benefits:**\n",
      "        *   Improved accuracy in diagnoses and treatment plans.\n",
      "        *   Increased access to healthcare, especially in underserved areas.\n",
      "        *   Reduced human error in complex procedures.\n",
      "        *   Faster response times in emergency situations.\n",
      "        *   Personalized medicine tailored to individual patient needs.\n",
      "    *   **Harms:**\n",
      "        *   Misdiagnosis or inappropriate treatment due to biased data or flawed algorithms.\n",
      "        *   Erosion of the doctor-patient relationship and loss of human empathy.\n",
      "        *   Privacy violations due to the collection and use of sensitive patient data.\n",
      "        *   Deskilling of medical professionals as they rely more on AI.\n",
      "        *   Exacerbation of existing health disparities if AI systems are trained on biased data.\n",
      "\n",
      "*   **Military Applications:**\n",
      "    *   **Benefits:**\n",
      "        *   Reduced casualties by removing soldiers from dangerous situations.\n",
      "        *   Improved precision in targeting and minimizing collateral damage.\n",
      "        *   Faster decision-making in combat situations.\n",
      "        *   Enhanced situational awareness through real-time data analysis.\n",
      "    *   **Harms:**\n",
      "        *   Unintended escalation of conflicts due to algorithmic errors.\n",
      "        *   Loss of human control over lethal force.\n",
      "        *   Dehumanization of warfare.\n",
      "        *   Increased risk of autonomous weapons falling into the wrong hands.\n",
      "        *   Lack of accountability for unintended consequences.\n",
      "\n",
      "**2. Addressing Ethical Principles:**\n",
      "\n",
      "*   **Autonomy and Human Control:**\n",
      "    *   How much control should humans retain over AI decisions?\n",
      "    *   Can AI systems be designed to respect human autonomy and values?\n",
      "    *   What safeguards can be implemented to prevent AI from exceeding its intended scope of authority?\n",
      "\n",
      "*   **Beneficence and Non-Maleficence (Do good and do no harm):**\n",
      "    *   How can we ensure that AI systems are designed to maximize benefits and minimize risks?\n",
      "    *   What measures can be taken to mitigate the potential for harm, such as bias, errors, and unintended consequences?\n",
      "    *   How do we balance the potential benefits against the risks, especially when lives are at stake?\n",
      "\n",
      "*   **Justice and Fairness:**\n",
      "    *   How can we ensure that AI systems are fair and equitable, and do not discriminate against certain groups?\n",
      "    *   How can we address the potential for bias in training data and algorithms?\n",
      "    *   How can we ensure that everyone has equal access to the benefits of AI, regardless of their socioeconomic status or background?\n",
      "\n",
      "*   **Accountability and Transparency:**\n",
      "    *   Who is responsible when an AI system makes a mistake or causes harm?\n",
      "    *   How can we ensure that AI systems are transparent and explainable, so that users can understand how they arrived at their decisions?\n",
      "    *   What mechanisms can be put in place to monitor and audit AI systems to ensure that they are performing as intended and are not causing unintended harm?\n",
      "\n",
      "*   **Privacy and Security:**\n",
      "    *   How can we protect the privacy and security of sensitive data used by AI systems?\n",
      "    *   What measures can be taken to prevent unauthorized access to or misuse of AI systems?\n",
      "    *   How can we ensure that AI systems comply with relevant data protection regulations?\n",
      "\n",
      "**3. Mitigating Risks:**\n",
      "\n",
      "*   **Bias Detection and Mitigation:** Implement rigorous testing and validation processes to identify and mitigate bias in training data and algorithms. Employ techniques such as data augmentation, fairness-aware algorithms, and adversarial debiasing.\n",
      "*   **Explainability and Interpretability:** Design AI systems that provide clear explanations for their decisions, allowing users to understand the reasoning behind the recommendations.  Use techniques like SHAP values, LIME, and attention mechanisms to highlight important features.\n",
      "*   **Robustness and Reliability:** Develop AI systems that are robust to noisy data, adversarial attacks, and unforeseen circumstances. Conduct thorough testing and validation to ensure that the systems perform reliably in real-world scenarios.\n",
      "*   **Human Oversight and Control:** Implement mechanisms for human oversight and control, allowing users to intervene and override AI decisions when necessary.  Design systems with clear escalation pathways for complex or uncertain situations.\n",
      "*   **Continuous Monitoring and Evaluation:**  Establish a system for continuous monitoring and evaluation of AI system performance, identifying and addressing any issues that arise over time.  Regularly audit the system for bias, accuracy, and fairness.\n",
      "*   **Ethical Guidelines and Regulations:** Develop clear ethical guidelines and regulations for the development and deployment of AI in high-stakes situations.  Promote responsible AI practices through education, training, and certification programs.\n",
      "\n",
      "**4. Frameworks and Tools:**\n",
      "\n",
      "*   **Ethical Impact Assessments (EIAs):**  Conduct EIAs before deploying AI systems to identify and mitigate potential ethical risks.\n",
      "*   **AI Ethics Toolkits:**  Utilize AI ethics toolkits and frameworks to guide the development and deployment of responsible AI systems.\n",
      "*   **Stakeholder Engagement:**  Involve a wide range of stakeholders, including experts, policymakers, and the public, in the development and deployment of AI systems.\n",
      "*   **Public Debate and Education:**  Promote public debate and education about the ethical implications of AI.\n",
      "\n",
      "**5.  Specific Considerations for Healthcare and Military:**\n",
      "\n",
      "*   **Healthcare:** Patient autonomy and the physician-patient relationship must be central.  Transparent algorithms are crucial for trust.  Regulations should protect patient data and prevent discrimination.\n",
      "*   **Military:** International humanitarian law must be strictly adhered to.  Human control over lethal force must be maintained. Clear lines of accountability are essential.\n",
      "\n",
      "**Conclusion:**\n",
      "\n",
      "Developing autonomous AI for high-stakes situations requires a comprehensive and ethical approach that prioritizes human well-being, fairness, and accountability. By carefully considering the potential benefits and risks, addressing ethical principles, and implementing appropriate safeguards, we can harness the power of AI while mitigating the risks of unintended consequences.  A proactive, multidisciplinary, and constantly evolving approach is necessary to navigate the complex ethical landscape of autonomous AI in these critical domains.\n",
      "\n",
      "\n",
      "# Response from competitor 4\n",
      "\n",
      "The ethical implications of developing autonomous AI for high-stakes decision-making in fields like healthcare and military applications are profound and multifaceted. Below is a structured evaluation of the key considerations, balancing potential benefits against risks:\n",
      "\n",
      "### **Potential Benefits**  \n",
      "1. **Efficiency & Precision**  \n",
      "   - In healthcare, AI can diagnose diseases faster and more accurately than humans, improving patient outcomes (e.g., radiology AI detecting tumors).  \n",
      "   - In military contexts, autonomous systems could reduce human error in defensive operations.  \n",
      "\n",
      "2. **Scalability & Accessibility**  \n",
      "   - AI can provide expert-level decision-making in underserved regions where human specialists are scarce.  \n",
      "   - Autonomous drones could deliver medical supplies in conflict zones without risking human lives.  \n",
      "\n",
      "3. **Reduction of Human Risk**  \n",
      "   - In warfare, AI-driven systems could minimize soldier casualties by handling dangerous reconnaissance or defusing explosives.  \n",
      "\n",
      "### **Key Ethical Risks & Challenges**  \n",
      "1. **Bias & Fairness**  \n",
      "   - AI trained on biased data may perpetuate discrimination (e.g., underdiagnosing diseases in minority groups).  \n",
      "   - Military AI could misidentify targets based on flawed training data, leading to civilian harm.  \n",
      "\n",
      "2. **Accountability & Responsibility**  \n",
      "   - If an AI system makes a fatal error in surgery or warfare, who is liable? The developer, operator, or the AI itself?  \n",
      "   - Lack of clear legal frameworks complicates accountability.  \n",
      "\n",
      "3. **Unintended Consequences & Loss of Control**  \n",
      "   - Autonomous weapons could escalate conflicts unpredictably if hacked or misused.  \n",
      "   - Over-reliance on AI in healthcare might erode human judgment and patient trust.  \n",
      "\n",
      "4. **Transparency & Explainability**  \n",
      "   - Many AI systems (e.g., deep learning models) are \"black boxes,\" making it hard to justify decisions.  \n",
      "   - In life-or-death scenarios, the inability to explain AI reasoning is ethically problematic.  \n",
      "\n",
      "### **Balancing Benefits & Risks: Ethical Frameworks**  \n",
      "1. **Human-in-the-Loop (HITL) Oversight**  \n",
      "   - Critical decisions (e.g., lethal force in warfare, major surgeries) should require human confirmation.  \n",
      "   - Ensures accountability while leveraging AI’s efficiency.  \n",
      "\n",
      "2. **Robust Bias Mitigation & Auditing**  \n",
      "   - Diverse training datasets and continuous bias testing.  \n",
      "   - Independent oversight bodies to audit AI systems pre-deployment.  \n",
      "\n",
      "3. **International Regulations & Norms**  \n",
      "   - Bans or strict treaties on fully autonomous weapons (e.g., UN discussions on lethal autonomous weapons).  \n",
      "   - Ethical guidelines for medical AI (e.g., WHO’s principles on AI in health).  \n",
      "\n",
      "4. **Explainable AI (XAI) Development**  \n",
      "   - Prioritizing interpretable models in high-stakes fields to ensure decisions can be scrutinized.  \n",
      "\n",
      "### **Conclusion**  \n",
      "While autonomous AI offers transformative potential in healthcare and defense, its ethical risks demand rigorous safeguards. The balance hinges on **transparency, accountability, and human oversight**—ensuring AI augments rather than replaces human judgment in morally consequential domains. Without these guardrails, the risks of harm, bias, and loss of control could outweigh the benefits. Policymakers, technologists, and ethicists must collaborate to establish boundaries that maximize societal good while minimizing harm.\n",
      "\n",
      "# Response from competitor 5\n",
      "\n",
      "Evaluating the ethical implications of developing artificial intelligence (AI) that can autonomously make decisions in high-stakes situations requires a comprehensive analysis of the potential benefits and risks. Here's a framework to consider:\n",
      "\n",
      "**Potential Benefits:**\n",
      "\n",
      "1. **Improved decision-making**: AI can process vast amounts of data, identify patterns, and make decisions faster and more accurately than humans in certain situations.\n",
      "2. **Enhanced efficiency**: AI can automate routine tasks, freeing up human resources for more complex and high-value tasks.\n",
      "3. **Increased accessibility**: AI can provide decision-making support in areas where human expertise is scarce or unavailable.\n",
      "4. **Personalized care**: AI can help tailor healthcare decisions to individual patients' needs, leading to better outcomes.\n",
      "\n",
      "**Risks and Concerns:**\n",
      "\n",
      "1. **Bias and discrimination**: AI systems can perpetuate and amplify existing biases if trained on biased data, leading to unfair outcomes.\n",
      "2. **Lack of accountability**: As AI systems make autonomous decisions, it can be challenging to determine responsibility for errors or adverse outcomes.\n",
      "3. **Unintended consequences**: AI systems can produce unintended consequences, such as unforeseen side effects or interactions with other systems.\n",
      "4. **Cybersecurity risks**: AI systems can be vulnerable to cyber attacks, compromising sensitive data and decision-making processes.\n",
      "5. **Transparency and explainability**: AI systems can be difficult to interpret, making it challenging to understand the reasoning behind their decisions.\n",
      "\n",
      "**Ethical Considerations:**\n",
      "\n",
      "1. **Respect for autonomy**: AI systems should be designed to respect human autonomy and decision-making capacity.\n",
      "2. **Non-maleficence**: AI systems should be designed to minimize harm and avoid causing unnecessary harm.\n",
      "3. **Beneficence**: AI systems should be designed to promote the well-being and best interests of individuals and society.\n",
      "4. **Justice**: AI systems should be designed to ensure fairness, equity, and distributive justice.\n",
      "\n",
      "**Mitigation Strategies:**\n",
      "\n",
      "1. **Data curation**: Ensure that training data is diverse, representative, and free from bias.\n",
      "2. **Algorithmic auditing**: Regularly audit AI systems for bias and errors.\n",
      "3. **Human oversight**: Implement human oversight and review processes to detect and correct errors.\n",
      "4. **Explainability and transparency**: Develop AI systems that provide clear explanations for their decisions.\n",
      "5. **Accountability mechanisms**: Establish clear accountability mechanisms for errors or adverse outcomes.\n",
      "6. **Cybersecurity measures**: Implement robust cybersecurity measures to protect AI systems and sensitive data.\n",
      "7. **Ethics guidelines and regulations**: Develop and enforce ethics guidelines and regulations for AI development and deployment.\n",
      "\n",
      "**Best Practices:**\n",
      "\n",
      "1. **Multidisciplinary development teams**: Assemble teams with diverse expertise, including ethicists, to ensure that AI systems are developed with ethical considerations in mind.\n",
      "2. **Inclusive and diverse testing**: Test AI systems with diverse datasets and user groups to identify and address potential biases.\n",
      "3. **Continuous monitoring and evaluation**: Regularly monitor and evaluate AI systems for performance, safety, and ethical implications.\n",
      "4. **Transparency and communication**: Communicate clearly with stakeholders about AI system capabilities, limitations, and potential risks.\n",
      "5. **Ongoing education and training**: Provide ongoing education and training for developers, deployers, and users of AI systems to ensure they understand the ethical implications of AI decision-making.\n",
      "\n",
      "By considering these factors and implementing mitigation strategies, we can develop AI systems that balance the potential benefits of autonomous decision-making with the need to address ethical concerns and minimize risks.\n",
      "\n",
      "# Response from competitor 6\n",
      "\n",
      "Evaluating the ethical implications of developing autonomous AI for high-stakes decision-making requires a comprehensive and multi-disciplinary approach. Here's a framework to consider the potential benefits and risks, and balance them accordingly:\n",
      "\n",
      "**Potential Benefits:**\n",
      "\n",
      "1. Enhanced efficiency: Autonomous AI can process vast amounts of data quickly and accurately, leading to faster decision-making in high-stakes situations.\n",
      "2. Improved accuracy: AI can reduce human error by analyzing objective data and making decisions based on evidence-based criteria.\n",
      "3. Scalability: Autonomous AI can provide consistent results across multiple patients or scenarios, without the variability introduced by human factors.\n",
      "\n",
      "**Potential Risks:**\n",
      "\n",
      "1. **Bias:** AI systems can perpetuate pre-existing biases if they are trained using biased data or algorithms that replicate discriminatory patterns.\n",
      "2. **Accountability:** As AI systems take on more decision-making authority, it becomes increasingly difficult to assign responsibility for errors or harm caused by those decisions.\n",
      "3. **Unintended Consequences:** AI systems may produce unforeseen outcomes due to their inability to fully comprehend the complexity of human experience.\n",
      "4. **Privacy and Security:** Autonomous AI in high-stakes situations can raise significant concerns regarding patient confidentiality, intellectual property protection, and data security.\n",
      "\n",
      "**Key Ethical Considerations:**\n",
      "\n",
      "1. **Value Alignment**: Ensure that AI systems align with core human values, such as compassion, dignity, and respect for autonomy.\n",
      "2. **Transparency and Explainability**: Develop AI systems that provide transparent decision-making processes, allowing humans to understand the reasoning behind decisions.\n",
      "3. **Equity and Fairness**: Implement measures to prevent bias in AI, ensuring fairness and equity across diverse populations.\n",
      "4. **Human Oversight and Review**: Establish mechanisms for human review and intervention to ensure accountability and correct potential errors or biases.\n",
      "5. **Responsible Development**: Foster a culture of responsible development, prioritizing safety, efficacy, and societal impact.\n",
      "\n",
      "**Recommendations:**\n",
      "\n",
      "1. Conduct thorough risk assessments and engage in open dialogue with stakeholders, including patients, healthcare professionals, and civil society representatives.\n",
      "2. Establish independent review boards to monitor AI system development, deployment, and performance.\n",
      "3. Develop comprehensive guidelines for data collection, processing, and storage, ensuring patient confidentiality and intellectual property protection.\n",
      "4. Foster international collaboration on AI governance, regulatory frameworks, and best practices to address global concerns.\n",
      "5. Invest in AI literacy initiatives to educate professionals and the general public about AI systems, their limitations, and potential risks.\n",
      "\n",
      "By following this framework and engaging in ongoing dialogue with stakeholders, we can ensure that autonomous AI developments are guided by ethical principles, prioritizing human well-being, safety, and dignity.\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": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "judge_messages = [{\"role\": \"user\", \"content\": judge}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"results\": [1, 3, 4, 6, 5, 2]}\n"
     ]
    }
   ],
   "source": [
    "# Judgement time!\n",
    "\n",
    "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=judge_messages)\n",
    "results = response.choices[0].message.content\n",
    "\n",
    "print(results)\n",
    "\n",
    "# display(Markdown(answer))\n",
    "# competitors.append(model_name)\n",
    "# answers.append(answer)\n",
    "\n",
    "\n",
    "\n",
    "\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": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Rank 1: gpt-4o-mini\n",
      "Rank 2: gemini-2.0-flash\n",
      "Rank 3: deepseek-chat\n",
      "Rank 4: llama3.2:latest\n",
      "Rank 5: llama-3.3-70b-versatile\n",
      "Rank 6: 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.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}