Spaces:
Sleeping
Sleeping
File size: 134,082 Bytes
d8652af |
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 |
{
"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": 3,
"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\n",
"from google import genai"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Always remember to do this!\n",
"load_dotenv(override=True)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"OpenAI API Key not set\n",
"Anthropic API Key not set (and this is optional)\n",
"Google API Key exists and begins AI\n",
"DeepSeek API Key not set (and this is optional)\n",
"Groq API Key not set (and this is optional)\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": 6,
"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": 7,
"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": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"messages"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"ename": "OpenAIError",
"evalue": "The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable",
"output_type": "error",
"traceback": [
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
"\u001b[31mOpenAIError\u001b[39m Traceback (most recent call last)",
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[8]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m openai = \u001b[43mOpenAI\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 2\u001b[39m response = openai.chat.completions.create(\n\u001b[32m 3\u001b[39m model=\u001b[33m\"\u001b[39m\u001b[33mgpt-5-mini\u001b[39m\u001b[33m\"\u001b[39m,\n\u001b[32m 4\u001b[39m messages=messages,\n\u001b[32m 5\u001b[39m )\n\u001b[32m 6\u001b[39m question = response.choices[\u001b[32m0\u001b[39m].message.content\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\openai\\_client.py:135\u001b[39m, in \u001b[36mOpenAI.__init__\u001b[39m\u001b[34m(self, api_key, organization, project, webhook_secret, base_url, websocket_base_url, timeout, max_retries, default_headers, default_query, http_client, _strict_response_validation)\u001b[39m\n\u001b[32m 133\u001b[39m api_key = os.environ.get(\u001b[33m\"\u001b[39m\u001b[33mOPENAI_API_KEY\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m 134\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m api_key \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m135\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m OpenAIError(\n\u001b[32m 136\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mThe api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 137\u001b[39m )\n\u001b[32m 138\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mcallable\u001b[39m(api_key):\n\u001b[32m 139\u001b[39m \u001b[38;5;28mself\u001b[39m.api_key = \u001b[33m\"\u001b[39m\u001b[33m\"\u001b[39m\n",
"\u001b[31mOpenAIError\u001b[39m: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable"
]
}
],
"source": [
"openai = OpenAI()\n",
"response = openai.chat.completions.create(\n",
" model=\"gpt-5-mini\",\n",
" messages=messages,\n",
")\n",
"question = response.choices[0].message.content\n",
"print(question)\n"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ChatCompletion(id='W6g3ad_7CL70juMP8qLXmAU', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='Design a societal framework where perfect predictive accuracy of individual actions is possible but universally known. Detail three *non-obvious* challenges this knowledge would create for human flourishing, and propose a corresponding *non-obvious* societal mechanism to mitigate each challenge, justifying your choices.', refusal=None, role='assistant', annotations=None, audio=None, function_call=None, tool_calls=None))], created=1765255259, model='gemini-2.5-flash', object='chat.completion', service_tier=None, system_fingerprint=None, usage=CompletionUsage(completion_tokens=55, prompt_tokens=33, total_tokens=1549, completion_tokens_details=None, prompt_tokens_details=None))\n",
"Design a societal framework where perfect predictive accuracy of individual actions is possible but universally known. Detail three *non-obvious* challenges this knowledge would create for human flourishing, and propose a corresponding *non-obvious* societal mechanism to mitigate each challenge, justifying your choices.\n"
]
}
],
"source": [
"client = OpenAI(\n",
" api_key = os.getenv(\"GOOGLE_API_KEY\"),\n",
" base_url = \"https://generativelanguage.googleapis.com/v1beta\"\n",
")\n",
"\n",
"response = client.chat.completions.create(\n",
" model=\"gemini-2.5-flash\",\n",
" messages=messages\n",
")\n",
"\n",
"print(response)\n",
"question = response.choices[0].message.content\n",
"print(question)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"competitors = []\n",
"answers = []\n",
"messages = [{\"role\": \"user\", \"content\": question}]"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'role': 'user',\n",
" 'content': 'Given the limitations of current computational models in truly understanding subjective human experience, how would you reconcile the inherent conflict between striving to accurately predict and generate human-like text while simultaneously acknowledging the impossibility of replicating the qualitative nature of consciousness?\\n'}]"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"messages"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Note - update since the videos\n",
"\n",
"I've updated the model names to use the latest models below, like GPT 5 and Claude Sonnet 4.5. It's worth noting that these models can be quite slow - like 1-2 minutes - but they do a great job! Feel free to switch them for faster models if you'd prefer, like the ones I use in the video."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# The API we know well\n",
"# I've updated this with the latest model, but it can take some time because it likes to think!\n",
"# Replace the model with gpt-4.1-mini if you'd prefer not to wait 1-2 mins\n",
"\n",
"model_name = \"gpt-5-nano\"\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": null,
"metadata": {},
"outputs": [],
"source": [
"# Anthropic has a slightly different API, and Max Tokens is required\n",
"\n",
"model_name = \"claude-sonnet-4-5\"\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": null,
"metadata": {},
"outputs": [],
"source": [
"gemini = OpenAI(api_key=google_api_key, base_url=\"https://generativelanguage.googleapis.com/v1beta/openai/\")\n",
"model_name = \"gemini-2.5-flash\"\n",
"\n",
"response = gemini.chat.completions.create(model=model_name, messages=messages)\n",
"answer = response.choices[0].message.content\n",
"\n",
"display(Markdown(answer))\n",
"competitors.append(model_name)\n",
"answers.append(answer)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"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": null,
"metadata": {},
"outputs": [],
"source": [
"# Updated with the latest Open Source model from OpenAI\n",
"\n",
"groq = OpenAI(api_key=groq_api_key, base_url=\"https://api.groq.com/openai/v1\")\n",
"model_name = \"openai/gpt-oss-120b\"\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": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"'ollama' is not recognized as an internal or external command,\n",
"operable program or batch file.\n"
]
}
],
"source": [
"!ollama pull llama3.2"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"ename": "APIConnectionError",
"evalue": "Connection error.",
"output_type": "error",
"traceback": [
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
"\u001b[31mConnectError\u001b[39m Traceback (most recent call last)",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpx\\_transports\\default.py:101\u001b[39m, in \u001b[36mmap_httpcore_exceptions\u001b[39m\u001b[34m()\u001b[39m\n\u001b[32m 100\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m101\u001b[39m \u001b[38;5;28;01myield\u001b[39;00m\n\u001b[32m 102\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpx\\_transports\\default.py:250\u001b[39m, in \u001b[36mHTTPTransport.handle_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 249\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m map_httpcore_exceptions():\n\u001b[32m--> \u001b[39m\u001b[32m250\u001b[39m resp = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_pool\u001b[49m\u001b[43m.\u001b[49m\u001b[43mhandle_request\u001b[49m\u001b[43m(\u001b[49m\u001b[43mreq\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 252\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(resp.stream, typing.Iterable)\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpcore\\_sync\\connection_pool.py:256\u001b[39m, in \u001b[36mConnectionPool.handle_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 255\u001b[39m \u001b[38;5;28mself\u001b[39m._close_connections(closing)\n\u001b[32m--> \u001b[39m\u001b[32m256\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m exc \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[32m 258\u001b[39m \u001b[38;5;66;03m# Return the response. Note that in this case we still have to manage\u001b[39;00m\n\u001b[32m 259\u001b[39m \u001b[38;5;66;03m# the point at which the response is closed.\u001b[39;00m\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpcore\\_sync\\connection_pool.py:236\u001b[39m, in \u001b[36mConnectionPool.handle_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 234\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 235\u001b[39m \u001b[38;5;66;03m# Send the request on the assigned connection.\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m236\u001b[39m response = \u001b[43mconnection\u001b[49m\u001b[43m.\u001b[49m\u001b[43mhandle_request\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 237\u001b[39m \u001b[43m \u001b[49m\u001b[43mpool_request\u001b[49m\u001b[43m.\u001b[49m\u001b[43mrequest\u001b[49m\n\u001b[32m 238\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 239\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m ConnectionNotAvailable:\n\u001b[32m 240\u001b[39m \u001b[38;5;66;03m# In some cases a connection may initially be available to\u001b[39;00m\n\u001b[32m 241\u001b[39m \u001b[38;5;66;03m# handle a request, but then become unavailable.\u001b[39;00m\n\u001b[32m 242\u001b[39m \u001b[38;5;66;03m#\u001b[39;00m\n\u001b[32m 243\u001b[39m \u001b[38;5;66;03m# In this case we clear the connection and try again.\u001b[39;00m\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpcore\\_sync\\connection.py:101\u001b[39m, in \u001b[36mHTTPConnection.handle_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 100\u001b[39m \u001b[38;5;28mself\u001b[39m._connect_failed = \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m101\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m exc\n\u001b[32m 103\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m._connection.handle_request(request)\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpcore\\_sync\\connection.py:78\u001b[39m, in \u001b[36mHTTPConnection.handle_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 77\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m._connection \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m---> \u001b[39m\u001b[32m78\u001b[39m stream = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_connect\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 80\u001b[39m ssl_object = stream.get_extra_info(\u001b[33m\"\u001b[39m\u001b[33mssl_object\u001b[39m\u001b[33m\"\u001b[39m)\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpcore\\_sync\\connection.py:124\u001b[39m, in \u001b[36mHTTPConnection._connect\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 123\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m Trace(\u001b[33m\"\u001b[39m\u001b[33mconnect_tcp\u001b[39m\u001b[33m\"\u001b[39m, logger, request, kwargs) \u001b[38;5;28;01mas\u001b[39;00m trace:\n\u001b[32m--> \u001b[39m\u001b[32m124\u001b[39m stream = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_network_backend\u001b[49m\u001b[43m.\u001b[49m\u001b[43mconnect_tcp\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 125\u001b[39m trace.return_value = stream\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpcore\\_backends\\sync.py:207\u001b[39m, in \u001b[36mSyncBackend.connect_tcp\u001b[39m\u001b[34m(self, host, port, timeout, local_address, socket_options)\u001b[39m\n\u001b[32m 202\u001b[39m exc_map: ExceptionMapping = {\n\u001b[32m 203\u001b[39m socket.timeout: ConnectTimeout,\n\u001b[32m 204\u001b[39m \u001b[38;5;167;01mOSError\u001b[39;00m: ConnectError,\n\u001b[32m 205\u001b[39m }\n\u001b[32m--> \u001b[39m\u001b[32m207\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m map_exceptions(exc_map):\n\u001b[32m 208\u001b[39m sock = socket.create_connection(\n\u001b[32m 209\u001b[39m address,\n\u001b[32m 210\u001b[39m timeout,\n\u001b[32m 211\u001b[39m source_address=source_address,\n\u001b[32m 212\u001b[39m )\n",
"\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.12.12-windows-x86_64-none\\Lib\\contextlib.py:158\u001b[39m, in \u001b[36m_GeneratorContextManager.__exit__\u001b[39m\u001b[34m(self, typ, value, traceback)\u001b[39m\n\u001b[32m 157\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m158\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mgen\u001b[49m\u001b[43m.\u001b[49m\u001b[43mthrow\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 159\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mStopIteration\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[32m 160\u001b[39m \u001b[38;5;66;03m# Suppress StopIteration *unless* it's the same exception that\u001b[39;00m\n\u001b[32m 161\u001b[39m \u001b[38;5;66;03m# was passed to throw(). This prevents a StopIteration\u001b[39;00m\n\u001b[32m 162\u001b[39m \u001b[38;5;66;03m# raised inside the \"with\" statement from being suppressed.\u001b[39;00m\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpcore\\_exceptions.py:14\u001b[39m, in \u001b[36mmap_exceptions\u001b[39m\u001b[34m(map)\u001b[39m\n\u001b[32m 13\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(exc, from_exc):\n\u001b[32m---> \u001b[39m\u001b[32m14\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m to_exc(exc) \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mexc\u001b[39;00m\n\u001b[32m 15\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m\n",
"\u001b[31mConnectError\u001b[39m: [WinError 10061] No connection could be made because the target machine actively refused it",
"\nThe above exception was the direct cause of the following exception:\n",
"\u001b[31mConnectError\u001b[39m Traceback (most recent call last)",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\openai\\_base_client.py:982\u001b[39m, in \u001b[36mSyncAPIClient.request\u001b[39m\u001b[34m(self, cast_to, options, stream, stream_cls)\u001b[39m\n\u001b[32m 981\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m982\u001b[39m response = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_client\u001b[49m\u001b[43m.\u001b[49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 983\u001b[39m \u001b[43m \u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 984\u001b[39m \u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[43m=\u001b[49m\u001b[43mstream\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_should_stream_response_body\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 985\u001b[39m \u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 986\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 987\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m httpx.TimeoutException \u001b[38;5;28;01mas\u001b[39;00m err:\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpx\\_client.py:914\u001b[39m, in \u001b[36mClient.send\u001b[39m\u001b[34m(self, request, stream, auth, follow_redirects)\u001b[39m\n\u001b[32m 912\u001b[39m auth = \u001b[38;5;28mself\u001b[39m._build_request_auth(request, auth)\n\u001b[32m--> \u001b[39m\u001b[32m914\u001b[39m response = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_send_handling_auth\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 915\u001b[39m \u001b[43m \u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 916\u001b[39m \u001b[43m \u001b[49m\u001b[43mauth\u001b[49m\u001b[43m=\u001b[49m\u001b[43mauth\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 917\u001b[39m \u001b[43m \u001b[49m\u001b[43mfollow_redirects\u001b[49m\u001b[43m=\u001b[49m\u001b[43mfollow_redirects\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 918\u001b[39m \u001b[43m \u001b[49m\u001b[43mhistory\u001b[49m\u001b[43m=\u001b[49m\u001b[43m[\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 919\u001b[39m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 920\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpx\\_client.py:942\u001b[39m, in \u001b[36mClient._send_handling_auth\u001b[39m\u001b[34m(self, request, auth, follow_redirects, history)\u001b[39m\n\u001b[32m 941\u001b[39m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m942\u001b[39m response = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_send_handling_redirects\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 943\u001b[39m \u001b[43m \u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 944\u001b[39m \u001b[43m \u001b[49m\u001b[43mfollow_redirects\u001b[49m\u001b[43m=\u001b[49m\u001b[43mfollow_redirects\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 945\u001b[39m \u001b[43m \u001b[49m\u001b[43mhistory\u001b[49m\u001b[43m=\u001b[49m\u001b[43mhistory\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 946\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 947\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpx\\_client.py:979\u001b[39m, in \u001b[36mClient._send_handling_redirects\u001b[39m\u001b[34m(self, request, follow_redirects, history)\u001b[39m\n\u001b[32m 977\u001b[39m hook(request)\n\u001b[32m--> \u001b[39m\u001b[32m979\u001b[39m response = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_send_single_request\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 980\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpx\\_client.py:1014\u001b[39m, in \u001b[36mClient._send_single_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 1013\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m request_context(request=request):\n\u001b[32m-> \u001b[39m\u001b[32m1014\u001b[39m response = \u001b[43mtransport\u001b[49m\u001b[43m.\u001b[49m\u001b[43mhandle_request\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1016\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(response.stream, SyncByteStream)\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpx\\_transports\\default.py:249\u001b[39m, in \u001b[36mHTTPTransport.handle_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 237\u001b[39m req = httpcore.Request(\n\u001b[32m 238\u001b[39m method=request.method,\n\u001b[32m 239\u001b[39m url=httpcore.URL(\n\u001b[32m (...)\u001b[39m\u001b[32m 247\u001b[39m extensions=request.extensions,\n\u001b[32m 248\u001b[39m )\n\u001b[32m--> \u001b[39m\u001b[32m249\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m map_httpcore_exceptions():\n\u001b[32m 250\u001b[39m resp = \u001b[38;5;28mself\u001b[39m._pool.handle_request(req)\n",
"\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.12.12-windows-x86_64-none\\Lib\\contextlib.py:158\u001b[39m, in \u001b[36m_GeneratorContextManager.__exit__\u001b[39m\u001b[34m(self, typ, value, traceback)\u001b[39m\n\u001b[32m 157\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m158\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mgen\u001b[49m\u001b[43m.\u001b[49m\u001b[43mthrow\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 159\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mStopIteration\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[32m 160\u001b[39m \u001b[38;5;66;03m# Suppress StopIteration *unless* it's the same exception that\u001b[39;00m\n\u001b[32m 161\u001b[39m \u001b[38;5;66;03m# was passed to throw(). This prevents a StopIteration\u001b[39;00m\n\u001b[32m 162\u001b[39m \u001b[38;5;66;03m# raised inside the \"with\" statement from being suppressed.\u001b[39;00m\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\httpx\\_transports\\default.py:118\u001b[39m, in \u001b[36mmap_httpcore_exceptions\u001b[39m\u001b[34m()\u001b[39m\n\u001b[32m 117\u001b[39m message = \u001b[38;5;28mstr\u001b[39m(exc)\n\u001b[32m--> \u001b[39m\u001b[32m118\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m mapped_exc(message) \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mexc\u001b[39;00m\n",
"\u001b[31mConnectError\u001b[39m: [WinError 10061] No connection could be made because the target machine actively refused it",
"\nThe above exception was the direct cause of the following exception:\n",
"\u001b[31mAPIConnectionError\u001b[39m Traceback (most recent call last)",
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[13]\u001b[39m\u001b[32m, line 4\u001b[39m\n\u001b[32m 1\u001b[39m ollama = OpenAI(base_url=\u001b[33m'\u001b[39m\u001b[33mhttp://localhost:11434/v1\u001b[39m\u001b[33m'\u001b[39m, api_key=\u001b[33m'\u001b[39m\u001b[33mollama\u001b[39m\u001b[33m'\u001b[39m)\n\u001b[32m 2\u001b[39m model_name = \u001b[33m\"\u001b[39m\u001b[33mllama3.2\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m4\u001b[39m response = \u001b[43mollama\u001b[49m\u001b[43m.\u001b[49m\u001b[43mchat\u001b[49m\u001b[43m.\u001b[49m\u001b[43mcompletions\u001b[49m\u001b[43m.\u001b[49m\u001b[43mcreate\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmodel\u001b[49m\u001b[43m=\u001b[49m\u001b[43mmodel_name\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmessages\u001b[49m\u001b[43m=\u001b[49m\u001b[43mmessages\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 5\u001b[39m answer = response.choices[\u001b[32m0\u001b[39m].message.content\n\u001b[32m 7\u001b[39m display(Markdown(answer))\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\openai\\_utils\\_utils.py:286\u001b[39m, in \u001b[36mrequired_args.<locals>.inner.<locals>.wrapper\u001b[39m\u001b[34m(*args, **kwargs)\u001b[39m\n\u001b[32m 284\u001b[39m msg = \u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mMissing required argument: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mquote(missing[\u001b[32m0\u001b[39m])\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m\"\u001b[39m\n\u001b[32m 285\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m(msg)\n\u001b[32m--> \u001b[39m\u001b[32m286\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\openai\\resources\\chat\\completions\\completions.py:1147\u001b[39m, in \u001b[36mCompletions.create\u001b[39m\u001b[34m(self, messages, model, audio, frequency_penalty, function_call, functions, logit_bias, logprobs, max_completion_tokens, max_tokens, metadata, modalities, n, parallel_tool_calls, prediction, presence_penalty, prompt_cache_key, reasoning_effort, response_format, safety_identifier, seed, service_tier, stop, store, stream, stream_options, temperature, tool_choice, tools, top_logprobs, top_p, user, verbosity, web_search_options, extra_headers, extra_query, extra_body, timeout)\u001b[39m\n\u001b[32m 1101\u001b[39m \u001b[38;5;129m@required_args\u001b[39m([\u001b[33m\"\u001b[39m\u001b[33mmessages\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mmodel\u001b[39m\u001b[33m\"\u001b[39m], [\u001b[33m\"\u001b[39m\u001b[33mmessages\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mmodel\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mstream\u001b[39m\u001b[33m\"\u001b[39m])\n\u001b[32m 1102\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mcreate\u001b[39m(\n\u001b[32m 1103\u001b[39m \u001b[38;5;28mself\u001b[39m,\n\u001b[32m (...)\u001b[39m\u001b[32m 1144\u001b[39m timeout: \u001b[38;5;28mfloat\u001b[39m | httpx.Timeout | \u001b[38;5;28;01mNone\u001b[39;00m | NotGiven = not_given,\n\u001b[32m 1145\u001b[39m ) -> ChatCompletion | Stream[ChatCompletionChunk]:\n\u001b[32m 1146\u001b[39m validate_response_format(response_format)\n\u001b[32m-> \u001b[39m\u001b[32m1147\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_post\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 1148\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43m/chat/completions\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[32m 1149\u001b[39m \u001b[43m \u001b[49m\u001b[43mbody\u001b[49m\u001b[43m=\u001b[49m\u001b[43mmaybe_transform\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 1150\u001b[39m \u001b[43m \u001b[49m\u001b[43m{\u001b[49m\n\u001b[32m 1151\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mmessages\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mmessages\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1152\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mmodel\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mmodel\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1153\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43maudio\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43maudio\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1154\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mfrequency_penalty\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mfrequency_penalty\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1155\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mfunction_call\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mfunction_call\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1156\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mfunctions\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mfunctions\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1157\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mlogit_bias\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mlogit_bias\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1158\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mlogprobs\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mlogprobs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1159\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mmax_completion_tokens\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mmax_completion_tokens\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1160\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mmax_tokens\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mmax_tokens\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1161\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mmetadata\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mmetadata\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1162\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mmodalities\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mmodalities\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1163\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mn\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1164\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mparallel_tool_calls\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mparallel_tool_calls\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1165\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mprediction\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mprediction\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1166\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mpresence_penalty\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mpresence_penalty\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1167\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mprompt_cache_key\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mprompt_cache_key\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1168\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mreasoning_effort\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mreasoning_effort\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1169\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mresponse_format\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mresponse_format\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1170\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43msafety_identifier\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43msafety_identifier\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1171\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mseed\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mseed\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1172\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mservice_tier\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mservice_tier\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1173\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mstop\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mstop\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1174\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mstore\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mstore\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1175\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mstream\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1176\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mstream_options\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mstream_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1177\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mtemperature\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mtemperature\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1178\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mtool_choice\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mtool_choice\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1179\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mtools\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mtools\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1180\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mtop_logprobs\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mtop_logprobs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1181\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mtop_p\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mtop_p\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1182\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43muser\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43muser\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1183\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mverbosity\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mverbosity\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1184\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mweb_search_options\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mweb_search_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1185\u001b[39m \u001b[43m \u001b[49m\u001b[43m}\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1186\u001b[39m \u001b[43m \u001b[49m\u001b[43mcompletion_create_params\u001b[49m\u001b[43m.\u001b[49m\u001b[43mCompletionCreateParamsStreaming\u001b[49m\n\u001b[32m 1187\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mif\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\n\u001b[32m 1188\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;28;43;01melse\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mcompletion_create_params\u001b[49m\u001b[43m.\u001b[49m\u001b[43mCompletionCreateParamsNonStreaming\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1189\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1190\u001b[39m \u001b[43m \u001b[49m\u001b[43moptions\u001b[49m\u001b[43m=\u001b[49m\u001b[43mmake_request_options\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 1191\u001b[39m \u001b[43m \u001b[49m\u001b[43mextra_headers\u001b[49m\u001b[43m=\u001b[49m\u001b[43mextra_headers\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mextra_query\u001b[49m\u001b[43m=\u001b[49m\u001b[43mextra_query\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mextra_body\u001b[49m\u001b[43m=\u001b[49m\u001b[43mextra_body\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtimeout\u001b[49m\n\u001b[32m 1192\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1193\u001b[39m \u001b[43m \u001b[49m\u001b[43mcast_to\u001b[49m\u001b[43m=\u001b[49m\u001b[43mChatCompletion\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1194\u001b[39m \u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[43m=\u001b[49m\u001b[43mstream\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m 1195\u001b[39m \u001b[43m \u001b[49m\u001b[43mstream_cls\u001b[49m\u001b[43m=\u001b[49m\u001b[43mStream\u001b[49m\u001b[43m[\u001b[49m\u001b[43mChatCompletionChunk\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1196\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\openai\\_base_client.py:1259\u001b[39m, in \u001b[36mSyncAPIClient.post\u001b[39m\u001b[34m(self, path, cast_to, body, options, files, stream, stream_cls)\u001b[39m\n\u001b[32m 1245\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mpost\u001b[39m(\n\u001b[32m 1246\u001b[39m \u001b[38;5;28mself\u001b[39m,\n\u001b[32m 1247\u001b[39m path: \u001b[38;5;28mstr\u001b[39m,\n\u001b[32m (...)\u001b[39m\u001b[32m 1254\u001b[39m stream_cls: \u001b[38;5;28mtype\u001b[39m[_StreamT] | \u001b[38;5;28;01mNone\u001b[39;00m = \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[32m 1255\u001b[39m ) -> ResponseT | _StreamT:\n\u001b[32m 1256\u001b[39m opts = FinalRequestOptions.construct(\n\u001b[32m 1257\u001b[39m method=\u001b[33m\"\u001b[39m\u001b[33mpost\u001b[39m\u001b[33m\"\u001b[39m, url=path, json_data=body, files=to_httpx_files(files), **options\n\u001b[32m 1258\u001b[39m )\n\u001b[32m-> \u001b[39m\u001b[32m1259\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m cast(ResponseT, \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcast_to\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mopts\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[43m=\u001b[49m\u001b[43mstream\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstream_cls\u001b[49m\u001b[43m=\u001b[49m\u001b[43mstream_cls\u001b[49m\u001b[43m)\u001b[49m)\n",
"\u001b[36mFile \u001b[39m\u001b[32mg:\\Udemy\\projects\\agents\\.venv\\Lib\\site-packages\\openai\\_base_client.py:1014\u001b[39m, in \u001b[36mSyncAPIClient.request\u001b[39m\u001b[34m(self, cast_to, options, stream, stream_cls)\u001b[39m\n\u001b[32m 1011\u001b[39m \u001b[38;5;28;01mcontinue\u001b[39;00m\n\u001b[32m 1013\u001b[39m log.debug(\u001b[33m\"\u001b[39m\u001b[33mRaising connection error\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m-> \u001b[39m\u001b[32m1014\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m APIConnectionError(request=request) \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01merr\u001b[39;00m\n\u001b[32m 1016\u001b[39m log.debug(\n\u001b[32m 1017\u001b[39m \u001b[33m'\u001b[39m\u001b[33mHTTP Response: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m \u001b[39m\u001b[33m\"\u001b[39m\u001b[38;5;132;01m%i\u001b[39;00m\u001b[33m \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m\"\u001b[39m\u001b[33m \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m'\u001b[39m,\n\u001b[32m 1018\u001b[39m request.method,\n\u001b[32m (...)\u001b[39m\u001b[32m 1022\u001b[39m response.headers,\n\u001b[32m 1023\u001b[39m )\n\u001b[32m 1024\u001b[39m log.debug(\u001b[33m\"\u001b[39m\u001b[33mrequest_id: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m\"\u001b[39m, response.headers.get(\u001b[33m\"\u001b[39m\u001b[33mx-request-id\u001b[39m\u001b[33m\"\u001b[39m))\n",
"\u001b[31mAPIConnectionError\u001b[39m: Connection error."
]
}
],
"source": [
"ollama = OpenAI(base_url='http://localhost:11434/v1', api_key='ollama')\n",
"model_name = \"llama3.2\"\n",
"\n",
"response = ollama.chat.completions.create(model=model_name, messages=messages)\n",
"answer = response.choices[0].message.content\n",
"\n",
"display(Markdown(answer))\n",
"competitors.append(model_name)\n",
"answers.append(answer)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"Imagine a societal framework, let's call it \"Aethel,\" where a global, decentralized AI network, \"The Chronos Engine,\" possesses perfect predictive accuracy for all individual actions, large and small, from the moment of birth until death. This prediction is not just a probability; it's a certainty, derived from an unimaginably complex understanding of physics, biology, psychology, and environment. Crucially, this predictive data, encompassing every individual's life trajectory, choices, and their ripple effects, is universally accessible and verifiable. There are no secrets about anyone's future actions, nor about the ultimate outcome of any endeavor. The knowledge is ubiquitous and undeniable.\n",
"\n",
"While this system eliminates crime (as any illicit act would be known and thus preemptively averted or its consequences perfectly managed), optimizes resource allocation, and maximizes efficiency in most aspects of life, it introduces profound and non-obvious challenges to the very core of human flourishing:\n",
"\n",
"---\n",
"\n",
"### Non-Obvious Challenge 1: The Erosion of Experiential Value and the Burden of the Known Journey\n",
"\n",
"**Challenge Detail:**\n",
"In Aethel, the joy of discovery, the thrill of unexpected success, the pride of overcoming a daunting struggle, or the profound grief of an unforeseen loss are profoundly diminished. If an artist knows their masterpiece will fail to resonate, will they create it with the same passion? If an explorer knows the exact outcome and route of their expedition, where is the sense of true adventure? If parents know every future joy and sorrow of their child, does the unpredictable magic of raising them transform into merely watching a predetermined script unfold? The *experiential value* of the journey itself β the struggle, the uncertainty, the hope, the surprise β is critically undermined. Humans thrive on the *unfolding* of life, the feeling that their efforts *matter* in shaping an unknown future. When all is known, the \"future\" becomes a \"present\" that just hasn't happened yet, turning life into a series of highly detailed reenactments, potentially leading to widespread apathy, existential boredom, and a profound sense of futility, despite optimal outcomes. It's not just about free will (a philosophical debate), but about the *psychological and emotional engagement* with life's processes.\n",
"\n",
"**Non-Obvious Societal Mechanism: \"Temporal Blinders\" and \"Conscious Unknowing Rituals\"**\n",
"\n",
"To mitigate this, Aethel implements a system of \"Temporal Blinders.\" While the Chronos Engine knows everything, individuals can opt to redact specific periods of their *own* predictive data from their *personal* access, and from the general public. For instance, an artist can choose to redact the outcome of their next creative project for the duration of its creation and initial reception; a couple can redact the exact trajectory of their relationship for the first year; an individual facing a personal challenge can redact their specific steps and the immediate outcome for a defined period.\n",
"\n",
"Crucially, this redaction doesn't erase the knowledge from the system or others; it simply makes it inaccessible to the *individual* making the choice, and to those *directly involved* who also consent to the redaction. This creates pockets of *personal, consensual \"unknowing\"*. Society holds \"Conscious Unknowing Rituals\" where individuals formally declare their chosen redactions, and community members commit to upholding the \"blinder\" β refraining from revealing the known future to the redacting individual, even if they themselves know it. This transforms the act of creation, exploration, or relationship-building from a reenactment into an experience with subjectively genuine stakes, effort, and surprise, albeit within a universally known deterministic framework. The *choice* to be ignorant, even temporarily, becomes a deeply valued act of embracing human experience.\n",
"\n",
"**Justification:** This mechanism doesn't deny the underlying determinism but reclaims the *subjective experience* of uncertainty and discovery. It acknowledges that human flourishing isn't just about optimal outcomes, but about the *meaning derived from the process*. By allowing individuals to intentionally (and temporarily) *opt out* of knowing their own future in specific domains, it restores the psychological space for genuine effort, hope, and surprise, which are vital components of emotional well-being and a sense of purpose. It shifts the burden of the known future from a constant oppressive weight to a chosen, strategic tool.\n",
"\n",
"---\n",
"\n",
"### Non-Obvious Challenge 2: The Tyranny of the Optimal and the Devaluation of Divergence\n",
"\n",
"**Challenge Detail:**\n",
"With perfect predictive accuracy, the \"optimal\" path for any individual β career, education, relationships, health, lifestyle β becomes definitively known. Society naturally and logically gravitates towards these optimal paths, as deviating would be seen as inefficient, irrational, or even irresponsible, leading to demonstrably worse outcomes. This creates immense societal pressure to conform to one's predicted optimal trajectory. The consequence is a profound devaluation of *divergent, suboptimal, or purely serendipitous* choices. Accidental discoveries, \"unprofitable\" hobbies that lead to unexpected personal growth, relationships that defy statistical odds but bring immense happiness, careers chosen for passion over predicted success β these might be suppressed or viewed as wasteful. Human flourishing thrives on variety, serendipity, and the freedom to experiment, even if it leads to perceived \"inefficiency\" or \"failure.\" A society where every choice is perfectly rational and optimal risks becoming sterile, homogenous, and stifling of the unique, sometimes illogical, forms of human expression and experience that enrich collective existence. The true value of an \"inefficient\" path that leads to unexpected wisdom, resilience, or a novel perspective could be lost.\n",
"\n",
"**Non-Obvious Societal Mechanism: \"The Serendipity Dividend\" and \"Narrative Curators\"**\n",
"\n",
"Aethel implements a \"Serendipity Dividend\" β a robust and prestigious societal program that actively funds, supports, and celebrates paths and projects specifically identified by the Chronos Engine as *non-optimal* or *divergent* from an individual's predicted peak efficiency or success. This isn't just welfare; it's a *deliberate investment* in human experiential diversity. Individuals who choose to consciously deviate from their predicted optimal path (e.g., an individual predicted to be a brilliant engineer choosing to pursue abstract art, or one predicted to remain single opting for a complex, statistically challenging relationship) are eligible for significant societal resources, mentorship, and public recognition.\n",
"\n",
"Furthermore, \"Narrative Curators\" are established as a respected profession. These individuals, using the Chronos Engine, identify and document the unique, unexpected, and often \"suboptimal\" journeys and their profound, often unpredictable, benefits to the individual and society. They create public narratives celebrating these choices, highlighting the wisdom gained from struggle, the beauty of the unexpected, and the novel insights that only arise from paths less traveled. This actively elevates the social status of divergence and serendipity.\n",
"\n",
"**Justification:** This mechanism directly counteracts the pressure to conform to \"the optimal.\" It institutionalizes the value of inefficiency, exploration, and unique personal journeys, recognizing that true flourishing encompasses more than just maximized outcomes. By providing resources and social prestige to those who choose divergent paths, it encourages a rich tapestry of human experience, fostering innovation, resilience, and a deeper understanding of human potential that might otherwise be overlooked by pure optimization. It preserves the vital human desire to explore, experiment, and define one's own path, even when a \"better\" one is known.\n",
"\n",
"---\n",
"\n",
"### Non-Obvious Challenge 3: The Predetermined Self and the Crisis of Genuine Connection\n",
"\n",
"**Challenge Detail:**\n",
"If every future thought, feeling, and action of an individual is known to everyone, it creates a profound crisis of authenticity and genuine connection. How can trust be built if every future betrayal or affirmation is already public knowledge? How can empathy truly develop if one already knows the precise nature and duration of another's suffering or joy? Vulnerability, often key to deep human bonds, loses its meaning if there are no true unknowns to reveal. Individuals might feel they are merely acting out a script, not truly *being* themselves, but rather performing a known future. This impacts self-perception, leading to an \"existential echo chamber\" where one's self-image is constantly reflected back as a predetermined entity. The very spontaneity and unburdened sincerity crucial for developing genuine love, friendship, or even professional collaboration is undermined, as every interaction is tinged with the foreknowledge of its precise trajectory and outcome. The effort of truly listening, empathizing, or forgiving diminishes if the exact resolution is already known.\n",
"\n",
"**Non-Obvious Societal Mechanism: \"Prognostic Embodiment\" and \"Shared Unfolding Pods\"**\n",
"\n",
"Aethel develops \"Prognostic Embodiment\" experiences. These are not merely data readouts, but highly advanced, consensual, immersive simulations powered by the Chronos Engine, allowing individuals to temporarily *experience* the predicted future actions, motivations, and emotional states of others (or even their past selves at different developmental stages). This provides a far deeper form of empathy than mere intellectual knowledge. For example, a parent could experience their teenage child's predicted rebellious phase and its underlying anxieties, allowing them to approach it with pre-emptive understanding rather than reaction. This transforms foreknowledge from a barrier to a bridge of radical empathy.\n",
"\n",
"Furthermore, \"Shared Unfolding Pods\" are established. These are carefully curated, small, and private groups where individuals, knowing each other's full life prognoses, commit to a radical form of \"process-based authenticity.\" The focus shifts from the \"what\" (which is known) to the \"how\" and \"why\" β specifically, *how* each person will consciously navigate their known future, *why* they anticipate specific emotional responses, and *how* the group will collectively support each other through those predetermined events. Authenticity in these pods lies not in the revelation of an unknown future, but in the vulnerable, real-time sharing of one's internal experience *of living out* a known future. The effort of connection becomes about the shared emotional journey through predestination, offering mutual validation and support within a fully transparent framework.\n",
"\n",
"**Justification:** This mechanism redefines the basis of genuine connection and authenticity in a world without secrets. Prognostic Embodiment transforms abstract data into visceral understanding, fostering a deeper, more profound form of empathy than previously possible. Shared Unfolding Pods, meanwhile, shift the focus of authenticity from revealing unknown facets of self to transparently sharing one's internal navigation of a known destiny. It allows for a new kind of trust and intimacy, born not from ignorance but from a shared, deep understanding of each other's pre-written paths and the human experience of living them out. It transforms the burden of the predetermined self into a unique opportunity for unparalleled collective consciousness and emotional resonance."
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"gemini = OpenAI(api_key=google_api_key, base_url=\"https://generativelanguage.googleapis.com/v1beta/openai/\")\n",
"model_name = \"gemini-2.5-flash\"\n",
"\n",
"response = gemini.chat.completions.create(model=model_name, messages=messages)\n",
"answer = response.choices[0].message.content\n",
"\n",
"display(Markdown(answer))\n",
"competitors.append(model_name)\n",
"answers.append(answer)\n"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['gemini-2.5-flash']\n",
"['Imagine a societal framework, let\\'s call it \"Aethel,\" where a global, decentralized AI network, \"The Chronos Engine,\" possesses perfect predictive accuracy for all individual actions, large and small, from the moment of birth until death. This prediction is not just a probability; it\\'s a certainty, derived from an unimaginably complex understanding of physics, biology, psychology, and environment. Crucially, this predictive data, encompassing every individual\\'s life trajectory, choices, and their ripple effects, is universally accessible and verifiable. There are no secrets about anyone\\'s future actions, nor about the ultimate outcome of any endeavor. The knowledge is ubiquitous and undeniable.\\n\\nWhile this system eliminates crime (as any illicit act would be known and thus preemptively averted or its consequences perfectly managed), optimizes resource allocation, and maximizes efficiency in most aspects of life, it introduces profound and non-obvious challenges to the very core of human flourishing:\\n\\n---\\n\\n### Non-Obvious Challenge 1: The Erosion of Experiential Value and the Burden of the Known Journey\\n\\n**Challenge Detail:**\\nIn Aethel, the joy of discovery, the thrill of unexpected success, the pride of overcoming a daunting struggle, or the profound grief of an unforeseen loss are profoundly diminished. If an artist knows their masterpiece will fail to resonate, will they create it with the same passion? If an explorer knows the exact outcome and route of their expedition, where is the sense of true adventure? If parents know every future joy and sorrow of their child, does the unpredictable magic of raising them transform into merely watching a predetermined script unfold? The *experiential value* of the journey itself β the struggle, the uncertainty, the hope, the surprise β is critically undermined. Humans thrive on the *unfolding* of life, the feeling that their efforts *matter* in shaping an unknown future. When all is known, the \"future\" becomes a \"present\" that just hasn\\'t happened yet, turning life into a series of highly detailed reenactments, potentially leading to widespread apathy, existential boredom, and a profound sense of futility, despite optimal outcomes. It\\'s not just about free will (a philosophical debate), but about the *psychological and emotional engagement* with life\\'s processes.\\n\\n**Non-Obvious Societal Mechanism: \"Temporal Blinders\" and \"Conscious Unknowing Rituals\"**\\n\\nTo mitigate this, Aethel implements a system of \"Temporal Blinders.\" While the Chronos Engine knows everything, individuals can opt to redact specific periods of their *own* predictive data from their *personal* access, and from the general public. For instance, an artist can choose to redact the outcome of their next creative project for the duration of its creation and initial reception; a couple can redact the exact trajectory of their relationship for the first year; an individual facing a personal challenge can redact their specific steps and the immediate outcome for a defined period.\\n\\nCrucially, this redaction doesn\\'t erase the knowledge from the system or others; it simply makes it inaccessible to the *individual* making the choice, and to those *directly involved* who also consent to the redaction. This creates pockets of *personal, consensual \"unknowing\"*. Society holds \"Conscious Unknowing Rituals\" where individuals formally declare their chosen redactions, and community members commit to upholding the \"blinder\" β refraining from revealing the known future to the redacting individual, even if they themselves know it. This transforms the act of creation, exploration, or relationship-building from a reenactment into an experience with subjectively genuine stakes, effort, and surprise, albeit within a universally known deterministic framework. The *choice* to be ignorant, even temporarily, becomes a deeply valued act of embracing human experience.\\n\\n**Justification:** This mechanism doesn\\'t deny the underlying determinism but reclaims the *subjective experience* of uncertainty and discovery. It acknowledges that human flourishing isn\\'t just about optimal outcomes, but about the *meaning derived from the process*. By allowing individuals to intentionally (and temporarily) *opt out* of knowing their own future in specific domains, it restores the psychological space for genuine effort, hope, and surprise, which are vital components of emotional well-being and a sense of purpose. It shifts the burden of the known future from a constant oppressive weight to a chosen, strategic tool.\\n\\n---\\n\\n### Non-Obvious Challenge 2: The Tyranny of the Optimal and the Devaluation of Divergence\\n\\n**Challenge Detail:**\\nWith perfect predictive accuracy, the \"optimal\" path for any individual β career, education, relationships, health, lifestyle β becomes definitively known. Society naturally and logically gravitates towards these optimal paths, as deviating would be seen as inefficient, irrational, or even irresponsible, leading to demonstrably worse outcomes. This creates immense societal pressure to conform to one\\'s predicted optimal trajectory. The consequence is a profound devaluation of *divergent, suboptimal, or purely serendipitous* choices. Accidental discoveries, \"unprofitable\" hobbies that lead to unexpected personal growth, relationships that defy statistical odds but bring immense happiness, careers chosen for passion over predicted success β these might be suppressed or viewed as wasteful. Human flourishing thrives on variety, serendipity, and the freedom to experiment, even if it leads to perceived \"inefficiency\" or \"failure.\" A society where every choice is perfectly rational and optimal risks becoming sterile, homogenous, and stifling of the unique, sometimes illogical, forms of human expression and experience that enrich collective existence. The true value of an \"inefficient\" path that leads to unexpected wisdom, resilience, or a novel perspective could be lost.\\n\\n**Non-Obvious Societal Mechanism: \"The Serendipity Dividend\" and \"Narrative Curators\"**\\n\\nAethel implements a \"Serendipity Dividend\" β a robust and prestigious societal program that actively funds, supports, and celebrates paths and projects specifically identified by the Chronos Engine as *non-optimal* or *divergent* from an individual\\'s predicted peak efficiency or success. This isn\\'t just welfare; it\\'s a *deliberate investment* in human experiential diversity. Individuals who choose to consciously deviate from their predicted optimal path (e.g., an individual predicted to be a brilliant engineer choosing to pursue abstract art, or one predicted to remain single opting for a complex, statistically challenging relationship) are eligible for significant societal resources, mentorship, and public recognition.\\n\\nFurthermore, \"Narrative Curators\" are established as a respected profession. These individuals, using the Chronos Engine, identify and document the unique, unexpected, and often \"suboptimal\" journeys and their profound, often unpredictable, benefits to the individual and society. They create public narratives celebrating these choices, highlighting the wisdom gained from struggle, the beauty of the unexpected, and the novel insights that only arise from paths less traveled. This actively elevates the social status of divergence and serendipity.\\n\\n**Justification:** This mechanism directly counteracts the pressure to conform to \"the optimal.\" It institutionalizes the value of inefficiency, exploration, and unique personal journeys, recognizing that true flourishing encompasses more than just maximized outcomes. By providing resources and social prestige to those who choose divergent paths, it encourages a rich tapestry of human experience, fostering innovation, resilience, and a deeper understanding of human potential that might otherwise be overlooked by pure optimization. It preserves the vital human desire to explore, experiment, and define one\\'s own path, even when a \"better\" one is known.\\n\\n---\\n\\n### Non-Obvious Challenge 3: The Predetermined Self and the Crisis of Genuine Connection\\n\\n**Challenge Detail:**\\nIf every future thought, feeling, and action of an individual is known to everyone, it creates a profound crisis of authenticity and genuine connection. How can trust be built if every future betrayal or affirmation is already public knowledge? How can empathy truly develop if one already knows the precise nature and duration of another\\'s suffering or joy? Vulnerability, often key to deep human bonds, loses its meaning if there are no true unknowns to reveal. Individuals might feel they are merely acting out a script, not truly *being* themselves, but rather performing a known future. This impacts self-perception, leading to an \"existential echo chamber\" where one\\'s self-image is constantly reflected back as a predetermined entity. The very spontaneity and unburdened sincerity crucial for developing genuine love, friendship, or even professional collaboration is undermined, as every interaction is tinged with the foreknowledge of its precise trajectory and outcome. The effort of truly listening, empathizing, or forgiving diminishes if the exact resolution is already known.\\n\\n**Non-Obvious Societal Mechanism: \"Prognostic Embodiment\" and \"Shared Unfolding Pods\"**\\n\\nAethel develops \"Prognostic Embodiment\" experiences. These are not merely data readouts, but highly advanced, consensual, immersive simulations powered by the Chronos Engine, allowing individuals to temporarily *experience* the predicted future actions, motivations, and emotional states of others (or even their past selves at different developmental stages). This provides a far deeper form of empathy than mere intellectual knowledge. For example, a parent could experience their teenage child\\'s predicted rebellious phase and its underlying anxieties, allowing them to approach it with pre-emptive understanding rather than reaction. This transforms foreknowledge from a barrier to a bridge of radical empathy.\\n\\nFurthermore, \"Shared Unfolding Pods\" are established. These are carefully curated, small, and private groups where individuals, knowing each other\\'s full life prognoses, commit to a radical form of \"process-based authenticity.\" The focus shifts from the \"what\" (which is known) to the \"how\" and \"why\" β specifically, *how* each person will consciously navigate their known future, *why* they anticipate specific emotional responses, and *how* the group will collectively support each other through those predetermined events. Authenticity in these pods lies not in the revelation of an unknown future, but in the vulnerable, real-time sharing of one\\'s internal experience *of living out* a known future. The effort of connection becomes about the shared emotional journey through predestination, offering mutual validation and support within a fully transparent framework.\\n\\n**Justification:** This mechanism redefines the basis of genuine connection and authenticity in a world without secrets. Prognostic Embodiment transforms abstract data into visceral understanding, fostering a deeper, more profound form of empathy than previously possible. Shared Unfolding Pods, meanwhile, shift the focus of authenticity from revealing unknown facets of self to transparently sharing one\\'s internal navigation of a known destiny. It allows for a new kind of trust and intimacy, born not from ignorance but from a shared, deep understanding of each other\\'s pre-written paths and the human experience of living them out. It transforms the burden of the predetermined self into a unique opportunity for unparalleled collective consciousness and emotional resonance.']\n"
]
}
],
"source": [
"# So where are we?\n",
"\n",
"print(competitors)\n",
"print(answers)\n"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Competitor: gemini-2.5-flash\n",
"\n",
"Imagine a societal framework, let's call it \"Aethel,\" where a global, decentralized AI network, \"The Chronos Engine,\" possesses perfect predictive accuracy for all individual actions, large and small, from the moment of birth until death. This prediction is not just a probability; it's a certainty, derived from an unimaginably complex understanding of physics, biology, psychology, and environment. Crucially, this predictive data, encompassing every individual's life trajectory, choices, and their ripple effects, is universally accessible and verifiable. There are no secrets about anyone's future actions, nor about the ultimate outcome of any endeavor. The knowledge is ubiquitous and undeniable.\n",
"\n",
"While this system eliminates crime (as any illicit act would be known and thus preemptively averted or its consequences perfectly managed), optimizes resource allocation, and maximizes efficiency in most aspects of life, it introduces profound and non-obvious challenges to the very core of human flourishing:\n",
"\n",
"---\n",
"\n",
"### Non-Obvious Challenge 1: The Erosion of Experiential Value and the Burden of the Known Journey\n",
"\n",
"**Challenge Detail:**\n",
"In Aethel, the joy of discovery, the thrill of unexpected success, the pride of overcoming a daunting struggle, or the profound grief of an unforeseen loss are profoundly diminished. If an artist knows their masterpiece will fail to resonate, will they create it with the same passion? If an explorer knows the exact outcome and route of their expedition, where is the sense of true adventure? If parents know every future joy and sorrow of their child, does the unpredictable magic of raising them transform into merely watching a predetermined script unfold? The *experiential value* of the journey itself β the struggle, the uncertainty, the hope, the surprise β is critically undermined. Humans thrive on the *unfolding* of life, the feeling that their efforts *matter* in shaping an unknown future. When all is known, the \"future\" becomes a \"present\" that just hasn't happened yet, turning life into a series of highly detailed reenactments, potentially leading to widespread apathy, existential boredom, and a profound sense of futility, despite optimal outcomes. It's not just about free will (a philosophical debate), but about the *psychological and emotional engagement* with life's processes.\n",
"\n",
"**Non-Obvious Societal Mechanism: \"Temporal Blinders\" and \"Conscious Unknowing Rituals\"**\n",
"\n",
"To mitigate this, Aethel implements a system of \"Temporal Blinders.\" While the Chronos Engine knows everything, individuals can opt to redact specific periods of their *own* predictive data from their *personal* access, and from the general public. For instance, an artist can choose to redact the outcome of their next creative project for the duration of its creation and initial reception; a couple can redact the exact trajectory of their relationship for the first year; an individual facing a personal challenge can redact their specific steps and the immediate outcome for a defined period.\n",
"\n",
"Crucially, this redaction doesn't erase the knowledge from the system or others; it simply makes it inaccessible to the *individual* making the choice, and to those *directly involved* who also consent to the redaction. This creates pockets of *personal, consensual \"unknowing\"*. Society holds \"Conscious Unknowing Rituals\" where individuals formally declare their chosen redactions, and community members commit to upholding the \"blinder\" β refraining from revealing the known future to the redacting individual, even if they themselves know it. This transforms the act of creation, exploration, or relationship-building from a reenactment into an experience with subjectively genuine stakes, effort, and surprise, albeit within a universally known deterministic framework. The *choice* to be ignorant, even temporarily, becomes a deeply valued act of embracing human experience.\n",
"\n",
"**Justification:** This mechanism doesn't deny the underlying determinism but reclaims the *subjective experience* of uncertainty and discovery. It acknowledges that human flourishing isn't just about optimal outcomes, but about the *meaning derived from the process*. By allowing individuals to intentionally (and temporarily) *opt out* of knowing their own future in specific domains, it restores the psychological space for genuine effort, hope, and surprise, which are vital components of emotional well-being and a sense of purpose. It shifts the burden of the known future from a constant oppressive weight to a chosen, strategic tool.\n",
"\n",
"---\n",
"\n",
"### Non-Obvious Challenge 2: The Tyranny of the Optimal and the Devaluation of Divergence\n",
"\n",
"**Challenge Detail:**\n",
"With perfect predictive accuracy, the \"optimal\" path for any individual β career, education, relationships, health, lifestyle β becomes definitively known. Society naturally and logically gravitates towards these optimal paths, as deviating would be seen as inefficient, irrational, or even irresponsible, leading to demonstrably worse outcomes. This creates immense societal pressure to conform to one's predicted optimal trajectory. The consequence is a profound devaluation of *divergent, suboptimal, or purely serendipitous* choices. Accidental discoveries, \"unprofitable\" hobbies that lead to unexpected personal growth, relationships that defy statistical odds but bring immense happiness, careers chosen for passion over predicted success β these might be suppressed or viewed as wasteful. Human flourishing thrives on variety, serendipity, and the freedom to experiment, even if it leads to perceived \"inefficiency\" or \"failure.\" A society where every choice is perfectly rational and optimal risks becoming sterile, homogenous, and stifling of the unique, sometimes illogical, forms of human expression and experience that enrich collective existence. The true value of an \"inefficient\" path that leads to unexpected wisdom, resilience, or a novel perspective could be lost.\n",
"\n",
"**Non-Obvious Societal Mechanism: \"The Serendipity Dividend\" and \"Narrative Curators\"**\n",
"\n",
"Aethel implements a \"Serendipity Dividend\" β a robust and prestigious societal program that actively funds, supports, and celebrates paths and projects specifically identified by the Chronos Engine as *non-optimal* or *divergent* from an individual's predicted peak efficiency or success. This isn't just welfare; it's a *deliberate investment* in human experiential diversity. Individuals who choose to consciously deviate from their predicted optimal path (e.g., an individual predicted to be a brilliant engineer choosing to pursue abstract art, or one predicted to remain single opting for a complex, statistically challenging relationship) are eligible for significant societal resources, mentorship, and public recognition.\n",
"\n",
"Furthermore, \"Narrative Curators\" are established as a respected profession. These individuals, using the Chronos Engine, identify and document the unique, unexpected, and often \"suboptimal\" journeys and their profound, often unpredictable, benefits to the individual and society. They create public narratives celebrating these choices, highlighting the wisdom gained from struggle, the beauty of the unexpected, and the novel insights that only arise from paths less traveled. This actively elevates the social status of divergence and serendipity.\n",
"\n",
"**Justification:** This mechanism directly counteracts the pressure to conform to \"the optimal.\" It institutionalizes the value of inefficiency, exploration, and unique personal journeys, recognizing that true flourishing encompasses more than just maximized outcomes. By providing resources and social prestige to those who choose divergent paths, it encourages a rich tapestry of human experience, fostering innovation, resilience, and a deeper understanding of human potential that might otherwise be overlooked by pure optimization. It preserves the vital human desire to explore, experiment, and define one's own path, even when a \"better\" one is known.\n",
"\n",
"---\n",
"\n",
"### Non-Obvious Challenge 3: The Predetermined Self and the Crisis of Genuine Connection\n",
"\n",
"**Challenge Detail:**\n",
"If every future thought, feeling, and action of an individual is known to everyone, it creates a profound crisis of authenticity and genuine connection. How can trust be built if every future betrayal or affirmation is already public knowledge? How can empathy truly develop if one already knows the precise nature and duration of another's suffering or joy? Vulnerability, often key to deep human bonds, loses its meaning if there are no true unknowns to reveal. Individuals might feel they are merely acting out a script, not truly *being* themselves, but rather performing a known future. This impacts self-perception, leading to an \"existential echo chamber\" where one's self-image is constantly reflected back as a predetermined entity. The very spontaneity and unburdened sincerity crucial for developing genuine love, friendship, or even professional collaboration is undermined, as every interaction is tinged with the foreknowledge of its precise trajectory and outcome. The effort of truly listening, empathizing, or forgiving diminishes if the exact resolution is already known.\n",
"\n",
"**Non-Obvious Societal Mechanism: \"Prognostic Embodiment\" and \"Shared Unfolding Pods\"**\n",
"\n",
"Aethel develops \"Prognostic Embodiment\" experiences. These are not merely data readouts, but highly advanced, consensual, immersive simulations powered by the Chronos Engine, allowing individuals to temporarily *experience* the predicted future actions, motivations, and emotional states of others (or even their past selves at different developmental stages). This provides a far deeper form of empathy than mere intellectual knowledge. For example, a parent could experience their teenage child's predicted rebellious phase and its underlying anxieties, allowing them to approach it with pre-emptive understanding rather than reaction. This transforms foreknowledge from a barrier to a bridge of radical empathy.\n",
"\n",
"Furthermore, \"Shared Unfolding Pods\" are established. These are carefully curated, small, and private groups where individuals, knowing each other's full life prognoses, commit to a radical form of \"process-based authenticity.\" The focus shifts from the \"what\" (which is known) to the \"how\" and \"why\" β specifically, *how* each person will consciously navigate their known future, *why* they anticipate specific emotional responses, and *how* the group will collectively support each other through those predetermined events. Authenticity in these pods lies not in the revelation of an unknown future, but in the vulnerable, real-time sharing of one's internal experience *of living out* a known future. The effort of connection becomes about the shared emotional journey through predestination, offering mutual validation and support within a fully transparent framework.\n",
"\n",
"**Justification:** This mechanism redefines the basis of genuine connection and authenticity in a world without secrets. Prognostic Embodiment transforms abstract data into visceral understanding, fostering a deeper, more profound form of empathy than previously possible. Shared Unfolding Pods, meanwhile, shift the focus of authenticity from revealing unknown facets of self to transparently sharing one's internal navigation of a known destiny. It allows for a new kind of trust and intimacy, born not from ignorance but from a shared, deep understanding of each other's pre-written paths and the human experience of living them out. It transforms the burden of the predetermined self into a unique opportunity for unparalleled collective consciousness and emotional resonance.\n"
]
}
],
"source": [
"# It's nice to know how to use \"zip\"\n",
"for competitor, answer in zip(competitors, answers):\n",
" print(f\"Competitor: {competitor}\\n\\n{answer}\")\n"
]
},
{
"cell_type": "code",
"execution_count": 17,
"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": 18,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"# Response from competitor 1\n",
"\n",
"Imagine a societal framework, let's call it \"Aethel,\" where a global, decentralized AI network, \"The Chronos Engine,\" possesses perfect predictive accuracy for all individual actions, large and small, from the moment of birth until death. This prediction is not just a probability; it's a certainty, derived from an unimaginably complex understanding of physics, biology, psychology, and environment. Crucially, this predictive data, encompassing every individual's life trajectory, choices, and their ripple effects, is universally accessible and verifiable. There are no secrets about anyone's future actions, nor about the ultimate outcome of any endeavor. The knowledge is ubiquitous and undeniable.\n",
"\n",
"While this system eliminates crime (as any illicit act would be known and thus preemptively averted or its consequences perfectly managed), optimizes resource allocation, and maximizes efficiency in most aspects of life, it introduces profound and non-obvious challenges to the very core of human flourishing:\n",
"\n",
"---\n",
"\n",
"### Non-Obvious Challenge 1: The Erosion of Experiential Value and the Burden of the Known Journey\n",
"\n",
"**Challenge Detail:**\n",
"In Aethel, the joy of discovery, the thrill of unexpected success, the pride of overcoming a daunting struggle, or the profound grief of an unforeseen loss are profoundly diminished. If an artist knows their masterpiece will fail to resonate, will they create it with the same passion? If an explorer knows the exact outcome and route of their expedition, where is the sense of true adventure? If parents know every future joy and sorrow of their child, does the unpredictable magic of raising them transform into merely watching a predetermined script unfold? The *experiential value* of the journey itself β the struggle, the uncertainty, the hope, the surprise β is critically undermined. Humans thrive on the *unfolding* of life, the feeling that their efforts *matter* in shaping an unknown future. When all is known, the \"future\" becomes a \"present\" that just hasn't happened yet, turning life into a series of highly detailed reenactments, potentially leading to widespread apathy, existential boredom, and a profound sense of futility, despite optimal outcomes. It's not just about free will (a philosophical debate), but about the *psychological and emotional engagement* with life's processes.\n",
"\n",
"**Non-Obvious Societal Mechanism: \"Temporal Blinders\" and \"Conscious Unknowing Rituals\"**\n",
"\n",
"To mitigate this, Aethel implements a system of \"Temporal Blinders.\" While the Chronos Engine knows everything, individuals can opt to redact specific periods of their *own* predictive data from their *personal* access, and from the general public. For instance, an artist can choose to redact the outcome of their next creative project for the duration of its creation and initial reception; a couple can redact the exact trajectory of their relationship for the first year; an individual facing a personal challenge can redact their specific steps and the immediate outcome for a defined period.\n",
"\n",
"Crucially, this redaction doesn't erase the knowledge from the system or others; it simply makes it inaccessible to the *individual* making the choice, and to those *directly involved* who also consent to the redaction. This creates pockets of *personal, consensual \"unknowing\"*. Society holds \"Conscious Unknowing Rituals\" where individuals formally declare their chosen redactions, and community members commit to upholding the \"blinder\" β refraining from revealing the known future to the redacting individual, even if they themselves know it. This transforms the act of creation, exploration, or relationship-building from a reenactment into an experience with subjectively genuine stakes, effort, and surprise, albeit within a universally known deterministic framework. The *choice* to be ignorant, even temporarily, becomes a deeply valued act of embracing human experience.\n",
"\n",
"**Justification:** This mechanism doesn't deny the underlying determinism but reclaims the *subjective experience* of uncertainty and discovery. It acknowledges that human flourishing isn't just about optimal outcomes, but about the *meaning derived from the process*. By allowing individuals to intentionally (and temporarily) *opt out* of knowing their own future in specific domains, it restores the psychological space for genuine effort, hope, and surprise, which are vital components of emotional well-being and a sense of purpose. It shifts the burden of the known future from a constant oppressive weight to a chosen, strategic tool.\n",
"\n",
"---\n",
"\n",
"### Non-Obvious Challenge 2: The Tyranny of the Optimal and the Devaluation of Divergence\n",
"\n",
"**Challenge Detail:**\n",
"With perfect predictive accuracy, the \"optimal\" path for any individual β career, education, relationships, health, lifestyle β becomes definitively known. Society naturally and logically gravitates towards these optimal paths, as deviating would be seen as inefficient, irrational, or even irresponsible, leading to demonstrably worse outcomes. This creates immense societal pressure to conform to one's predicted optimal trajectory. The consequence is a profound devaluation of *divergent, suboptimal, or purely serendipitous* choices. Accidental discoveries, \"unprofitable\" hobbies that lead to unexpected personal growth, relationships that defy statistical odds but bring immense happiness, careers chosen for passion over predicted success β these might be suppressed or viewed as wasteful. Human flourishing thrives on variety, serendipity, and the freedom to experiment, even if it leads to perceived \"inefficiency\" or \"failure.\" A society where every choice is perfectly rational and optimal risks becoming sterile, homogenous, and stifling of the unique, sometimes illogical, forms of human expression and experience that enrich collective existence. The true value of an \"inefficient\" path that leads to unexpected wisdom, resilience, or a novel perspective could be lost.\n",
"\n",
"**Non-Obvious Societal Mechanism: \"The Serendipity Dividend\" and \"Narrative Curators\"**\n",
"\n",
"Aethel implements a \"Serendipity Dividend\" β a robust and prestigious societal program that actively funds, supports, and celebrates paths and projects specifically identified by the Chronos Engine as *non-optimal* or *divergent* from an individual's predicted peak efficiency or success. This isn't just welfare; it's a *deliberate investment* in human experiential diversity. Individuals who choose to consciously deviate from their predicted optimal path (e.g., an individual predicted to be a brilliant engineer choosing to pursue abstract art, or one predicted to remain single opting for a complex, statistically challenging relationship) are eligible for significant societal resources, mentorship, and public recognition.\n",
"\n",
"Furthermore, \"Narrative Curators\" are established as a respected profession. These individuals, using the Chronos Engine, identify and document the unique, unexpected, and often \"suboptimal\" journeys and their profound, often unpredictable, benefits to the individual and society. They create public narratives celebrating these choices, highlighting the wisdom gained from struggle, the beauty of the unexpected, and the novel insights that only arise from paths less traveled. This actively elevates the social status of divergence and serendipity.\n",
"\n",
"**Justification:** This mechanism directly counteracts the pressure to conform to \"the optimal.\" It institutionalizes the value of inefficiency, exploration, and unique personal journeys, recognizing that true flourishing encompasses more than just maximized outcomes. By providing resources and social prestige to those who choose divergent paths, it encourages a rich tapestry of human experience, fostering innovation, resilience, and a deeper understanding of human potential that might otherwise be overlooked by pure optimization. It preserves the vital human desire to explore, experiment, and define one's own path, even when a \"better\" one is known.\n",
"\n",
"---\n",
"\n",
"### Non-Obvious Challenge 3: The Predetermined Self and the Crisis of Genuine Connection\n",
"\n",
"**Challenge Detail:**\n",
"If every future thought, feeling, and action of an individual is known to everyone, it creates a profound crisis of authenticity and genuine connection. How can trust be built if every future betrayal or affirmation is already public knowledge? How can empathy truly develop if one already knows the precise nature and duration of another's suffering or joy? Vulnerability, often key to deep human bonds, loses its meaning if there are no true unknowns to reveal. Individuals might feel they are merely acting out a script, not truly *being* themselves, but rather performing a known future. This impacts self-perception, leading to an \"existential echo chamber\" where one's self-image is constantly reflected back as a predetermined entity. The very spontaneity and unburdened sincerity crucial for developing genuine love, friendship, or even professional collaboration is undermined, as every interaction is tinged with the foreknowledge of its precise trajectory and outcome. The effort of truly listening, empathizing, or forgiving diminishes if the exact resolution is already known.\n",
"\n",
"**Non-Obvious Societal Mechanism: \"Prognostic Embodiment\" and \"Shared Unfolding Pods\"**\n",
"\n",
"Aethel develops \"Prognostic Embodiment\" experiences. These are not merely data readouts, but highly advanced, consensual, immersive simulations powered by the Chronos Engine, allowing individuals to temporarily *experience* the predicted future actions, motivations, and emotional states of others (or even their past selves at different developmental stages). This provides a far deeper form of empathy than mere intellectual knowledge. For example, a parent could experience their teenage child's predicted rebellious phase and its underlying anxieties, allowing them to approach it with pre-emptive understanding rather than reaction. This transforms foreknowledge from a barrier to a bridge of radical empathy.\n",
"\n",
"Furthermore, \"Shared Unfolding Pods\" are established. These are carefully curated, small, and private groups where individuals, knowing each other's full life prognoses, commit to a radical form of \"process-based authenticity.\" The focus shifts from the \"what\" (which is known) to the \"how\" and \"why\" β specifically, *how* each person will consciously navigate their known future, *why* they anticipate specific emotional responses, and *how* the group will collectively support each other through those predetermined events. Authenticity in these pods lies not in the revelation of an unknown future, but in the vulnerable, real-time sharing of one's internal experience *of living out* a known future. The effort of connection becomes about the shared emotional journey through predestination, offering mutual validation and support within a fully transparent framework.\n",
"\n",
"**Justification:** This mechanism redefines the basis of genuine connection and authenticity in a world without secrets. Prognostic Embodiment transforms abstract data into visceral understanding, fostering a deeper, more profound form of empathy than previously possible. Shared Unfolding Pods, meanwhile, shift the focus of authenticity from revealing unknown facets of self to transparently sharing one's internal navigation of a known destiny. It allows for a new kind of trust and intimacy, born not from ignorance but from a shared, deep understanding of each other's pre-written paths and the human experience of living them out. It transforms the burden of the predetermined self into a unique opportunity for unparalleled collective consciousness and emotional resonance.\n",
"\n",
"\n"
]
}
],
"source": [
"print(together)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": 19,
"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": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"You are judging a competition between 1 competitors.\n",
"Each model has been given this question:\n",
"\n",
"Design a societal framework where perfect predictive accuracy of individual actions is possible but universally known. Detail three *non-obvious* challenges this knowledge would create for human flourishing, and propose a corresponding *non-obvious* societal mechanism to mitigate each challenge, justifying your choices.\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",
"Imagine a societal framework, let's call it \"Aethel,\" where a global, decentralized AI network, \"The Chronos Engine,\" possesses perfect predictive accuracy for all individual actions, large and small, from the moment of birth until death. This prediction is not just a probability; it's a certainty, derived from an unimaginably complex understanding of physics, biology, psychology, and environment. Crucially, this predictive data, encompassing every individual's life trajectory, choices, and their ripple effects, is universally accessible and verifiable. There are no secrets about anyone's future actions, nor about the ultimate outcome of any endeavor. The knowledge is ubiquitous and undeniable.\n",
"\n",
"While this system eliminates crime (as any illicit act would be known and thus preemptively averted or its consequences perfectly managed), optimizes resource allocation, and maximizes efficiency in most aspects of life, it introduces profound and non-obvious challenges to the very core of human flourishing:\n",
"\n",
"---\n",
"\n",
"### Non-Obvious Challenge 1: The Erosion of Experiential Value and the Burden of the Known Journey\n",
"\n",
"**Challenge Detail:**\n",
"In Aethel, the joy of discovery, the thrill of unexpected success, the pride of overcoming a daunting struggle, or the profound grief of an unforeseen loss are profoundly diminished. If an artist knows their masterpiece will fail to resonate, will they create it with the same passion? If an explorer knows the exact outcome and route of their expedition, where is the sense of true adventure? If parents know every future joy and sorrow of their child, does the unpredictable magic of raising them transform into merely watching a predetermined script unfold? The *experiential value* of the journey itself β the struggle, the uncertainty, the hope, the surprise β is critically undermined. Humans thrive on the *unfolding* of life, the feeling that their efforts *matter* in shaping an unknown future. When all is known, the \"future\" becomes a \"present\" that just hasn't happened yet, turning life into a series of highly detailed reenactments, potentially leading to widespread apathy, existential boredom, and a profound sense of futility, despite optimal outcomes. It's not just about free will (a philosophical debate), but about the *psychological and emotional engagement* with life's processes.\n",
"\n",
"**Non-Obvious Societal Mechanism: \"Temporal Blinders\" and \"Conscious Unknowing Rituals\"**\n",
"\n",
"To mitigate this, Aethel implements a system of \"Temporal Blinders.\" While the Chronos Engine knows everything, individuals can opt to redact specific periods of their *own* predictive data from their *personal* access, and from the general public. For instance, an artist can choose to redact the outcome of their next creative project for the duration of its creation and initial reception; a couple can redact the exact trajectory of their relationship for the first year; an individual facing a personal challenge can redact their specific steps and the immediate outcome for a defined period.\n",
"\n",
"Crucially, this redaction doesn't erase the knowledge from the system or others; it simply makes it inaccessible to the *individual* making the choice, and to those *directly involved* who also consent to the redaction. This creates pockets of *personal, consensual \"unknowing\"*. Society holds \"Conscious Unknowing Rituals\" where individuals formally declare their chosen redactions, and community members commit to upholding the \"blinder\" β refraining from revealing the known future to the redacting individual, even if they themselves know it. This transforms the act of creation, exploration, or relationship-building from a reenactment into an experience with subjectively genuine stakes, effort, and surprise, albeit within a universally known deterministic framework. The *choice* to be ignorant, even temporarily, becomes a deeply valued act of embracing human experience.\n",
"\n",
"**Justification:** This mechanism doesn't deny the underlying determinism but reclaims the *subjective experience* of uncertainty and discovery. It acknowledges that human flourishing isn't just about optimal outcomes, but about the *meaning derived from the process*. By allowing individuals to intentionally (and temporarily) *opt out* of knowing their own future in specific domains, it restores the psychological space for genuine effort, hope, and surprise, which are vital components of emotional well-being and a sense of purpose. It shifts the burden of the known future from a constant oppressive weight to a chosen, strategic tool.\n",
"\n",
"---\n",
"\n",
"### Non-Obvious Challenge 2: The Tyranny of the Optimal and the Devaluation of Divergence\n",
"\n",
"**Challenge Detail:**\n",
"With perfect predictive accuracy, the \"optimal\" path for any individual β career, education, relationships, health, lifestyle β becomes definitively known. Society naturally and logically gravitates towards these optimal paths, as deviating would be seen as inefficient, irrational, or even irresponsible, leading to demonstrably worse outcomes. This creates immense societal pressure to conform to one's predicted optimal trajectory. The consequence is a profound devaluation of *divergent, suboptimal, or purely serendipitous* choices. Accidental discoveries, \"unprofitable\" hobbies that lead to unexpected personal growth, relationships that defy statistical odds but bring immense happiness, careers chosen for passion over predicted success β these might be suppressed or viewed as wasteful. Human flourishing thrives on variety, serendipity, and the freedom to experiment, even if it leads to perceived \"inefficiency\" or \"failure.\" A society where every choice is perfectly rational and optimal risks becoming sterile, homogenous, and stifling of the unique, sometimes illogical, forms of human expression and experience that enrich collective existence. The true value of an \"inefficient\" path that leads to unexpected wisdom, resilience, or a novel perspective could be lost.\n",
"\n",
"**Non-Obvious Societal Mechanism: \"The Serendipity Dividend\" and \"Narrative Curators\"**\n",
"\n",
"Aethel implements a \"Serendipity Dividend\" β a robust and prestigious societal program that actively funds, supports, and celebrates paths and projects specifically identified by the Chronos Engine as *non-optimal* or *divergent* from an individual's predicted peak efficiency or success. This isn't just welfare; it's a *deliberate investment* in human experiential diversity. Individuals who choose to consciously deviate from their predicted optimal path (e.g., an individual predicted to be a brilliant engineer choosing to pursue abstract art, or one predicted to remain single opting for a complex, statistically challenging relationship) are eligible for significant societal resources, mentorship, and public recognition.\n",
"\n",
"Furthermore, \"Narrative Curators\" are established as a respected profession. These individuals, using the Chronos Engine, identify and document the unique, unexpected, and often \"suboptimal\" journeys and their profound, often unpredictable, benefits to the individual and society. They create public narratives celebrating these choices, highlighting the wisdom gained from struggle, the beauty of the unexpected, and the novel insights that only arise from paths less traveled. This actively elevates the social status of divergence and serendipity.\n",
"\n",
"**Justification:** This mechanism directly counteracts the pressure to conform to \"the optimal.\" It institutionalizes the value of inefficiency, exploration, and unique personal journeys, recognizing that true flourishing encompasses more than just maximized outcomes. By providing resources and social prestige to those who choose divergent paths, it encourages a rich tapestry of human experience, fostering innovation, resilience, and a deeper understanding of human potential that might otherwise be overlooked by pure optimization. It preserves the vital human desire to explore, experiment, and define one's own path, even when a \"better\" one is known.\n",
"\n",
"---\n",
"\n",
"### Non-Obvious Challenge 3: The Predetermined Self and the Crisis of Genuine Connection\n",
"\n",
"**Challenge Detail:**\n",
"If every future thought, feeling, and action of an individual is known to everyone, it creates a profound crisis of authenticity and genuine connection. How can trust be built if every future betrayal or affirmation is already public knowledge? How can empathy truly develop if one already knows the precise nature and duration of another's suffering or joy? Vulnerability, often key to deep human bonds, loses its meaning if there are no true unknowns to reveal. Individuals might feel they are merely acting out a script, not truly *being* themselves, but rather performing a known future. This impacts self-perception, leading to an \"existential echo chamber\" where one's self-image is constantly reflected back as a predetermined entity. The very spontaneity and unburdened sincerity crucial for developing genuine love, friendship, or even professional collaboration is undermined, as every interaction is tinged with the foreknowledge of its precise trajectory and outcome. The effort of truly listening, empathizing, or forgiving diminishes if the exact resolution is already known.\n",
"\n",
"**Non-Obvious Societal Mechanism: \"Prognostic Embodiment\" and \"Shared Unfolding Pods\"**\n",
"\n",
"Aethel develops \"Prognostic Embodiment\" experiences. These are not merely data readouts, but highly advanced, consensual, immersive simulations powered by the Chronos Engine, allowing individuals to temporarily *experience* the predicted future actions, motivations, and emotional states of others (or even their past selves at different developmental stages). This provides a far deeper form of empathy than mere intellectual knowledge. For example, a parent could experience their teenage child's predicted rebellious phase and its underlying anxieties, allowing them to approach it with pre-emptive understanding rather than reaction. This transforms foreknowledge from a barrier to a bridge of radical empathy.\n",
"\n",
"Furthermore, \"Shared Unfolding Pods\" are established. These are carefully curated, small, and private groups where individuals, knowing each other's full life prognoses, commit to a radical form of \"process-based authenticity.\" The focus shifts from the \"what\" (which is known) to the \"how\" and \"why\" β specifically, *how* each person will consciously navigate their known future, *why* they anticipate specific emotional responses, and *how* the group will collectively support each other through those predetermined events. Authenticity in these pods lies not in the revelation of an unknown future, but in the vulnerable, real-time sharing of one's internal experience *of living out* a known future. The effort of connection becomes about the shared emotional journey through predestination, offering mutual validation and support within a fully transparent framework.\n",
"\n",
"**Justification:** This mechanism redefines the basis of genuine connection and authenticity in a world without secrets. Prognostic Embodiment transforms abstract data into visceral understanding, fostering a deeper, more profound form of empathy than previously possible. Shared Unfolding Pods, meanwhile, shift the focus of authenticity from revealing unknown facets of self to transparently sharing one's internal navigation of a known destiny. It allows for a new kind of trust and intimacy, born not from ignorance but from a shared, deep understanding of each other's pre-written paths and the human experience of living them out. It transforms the burden of the predetermined self into a unique opportunity for unparalleled collective consciousness and emotional resonance.\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": 21,
"metadata": {},
"outputs": [],
"source": [
"judge_messages = [{\"role\": \"user\", \"content\": judge}]"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[{'role': 'user', 'content': 'You are judging a competition between 1 competitors.\\nEach model has been given this question:\\n\\nDesign a societal framework where perfect predictive accuracy of individual actions is possible but universally known. Detail three *non-obvious* challenges this knowledge would create for human flourishing, and propose a corresponding *non-obvious* societal mechanism to mitigate each challenge, justifying your choices.\\n\\nYour job is to evaluate each response for clarity and strength of argument, and rank them in order of best to worst.\\nRespond with JSON, and only JSON, with the following format:\\n{\"results\": [\"best competitor number\", \"second best competitor number\", \"third best competitor number\", ...]}\\n\\nHere are the responses from each competitor:\\n\\n# Response from competitor 1\\n\\nImagine a societal framework, let\\'s call it \"Aethel,\" where a global, decentralized AI network, \"The Chronos Engine,\" possesses perfect predictive accuracy for all individual actions, large and small, from the moment of birth until death. This prediction is not just a probability; it\\'s a certainty, derived from an unimaginably complex understanding of physics, biology, psychology, and environment. Crucially, this predictive data, encompassing every individual\\'s life trajectory, choices, and their ripple effects, is universally accessible and verifiable. There are no secrets about anyone\\'s future actions, nor about the ultimate outcome of any endeavor. The knowledge is ubiquitous and undeniable.\\n\\nWhile this system eliminates crime (as any illicit act would be known and thus preemptively averted or its consequences perfectly managed), optimizes resource allocation, and maximizes efficiency in most aspects of life, it introduces profound and non-obvious challenges to the very core of human flourishing:\\n\\n---\\n\\n### Non-Obvious Challenge 1: The Erosion of Experiential Value and the Burden of the Known Journey\\n\\n**Challenge Detail:**\\nIn Aethel, the joy of discovery, the thrill of unexpected success, the pride of overcoming a daunting struggle, or the profound grief of an unforeseen loss are profoundly diminished. If an artist knows their masterpiece will fail to resonate, will they create it with the same passion? If an explorer knows the exact outcome and route of their expedition, where is the sense of true adventure? If parents know every future joy and sorrow of their child, does the unpredictable magic of raising them transform into merely watching a predetermined script unfold? The *experiential value* of the journey itself β the struggle, the uncertainty, the hope, the surprise β is critically undermined. Humans thrive on the *unfolding* of life, the feeling that their efforts *matter* in shaping an unknown future. When all is known, the \"future\" becomes a \"present\" that just hasn\\'t happened yet, turning life into a series of highly detailed reenactments, potentially leading to widespread apathy, existential boredom, and a profound sense of futility, despite optimal outcomes. It\\'s not just about free will (a philosophical debate), but about the *psychological and emotional engagement* with life\\'s processes.\\n\\n**Non-Obvious Societal Mechanism: \"Temporal Blinders\" and \"Conscious Unknowing Rituals\"**\\n\\nTo mitigate this, Aethel implements a system of \"Temporal Blinders.\" While the Chronos Engine knows everything, individuals can opt to redact specific periods of their *own* predictive data from their *personal* access, and from the general public. For instance, an artist can choose to redact the outcome of their next creative project for the duration of its creation and initial reception; a couple can redact the exact trajectory of their relationship for the first year; an individual facing a personal challenge can redact their specific steps and the immediate outcome for a defined period.\\n\\nCrucially, this redaction doesn\\'t erase the knowledge from the system or others; it simply makes it inaccessible to the *individual* making the choice, and to those *directly involved* who also consent to the redaction. This creates pockets of *personal, consensual \"unknowing\"*. Society holds \"Conscious Unknowing Rituals\" where individuals formally declare their chosen redactions, and community members commit to upholding the \"blinder\" β refraining from revealing the known future to the redacting individual, even if they themselves know it. This transforms the act of creation, exploration, or relationship-building from a reenactment into an experience with subjectively genuine stakes, effort, and surprise, albeit within a universally known deterministic framework. The *choice* to be ignorant, even temporarily, becomes a deeply valued act of embracing human experience.\\n\\n**Justification:** This mechanism doesn\\'t deny the underlying determinism but reclaims the *subjective experience* of uncertainty and discovery. It acknowledges that human flourishing isn\\'t just about optimal outcomes, but about the *meaning derived from the process*. By allowing individuals to intentionally (and temporarily) *opt out* of knowing their own future in specific domains, it restores the psychological space for genuine effort, hope, and surprise, which are vital components of emotional well-being and a sense of purpose. It shifts the burden of the known future from a constant oppressive weight to a chosen, strategic tool.\\n\\n---\\n\\n### Non-Obvious Challenge 2: The Tyranny of the Optimal and the Devaluation of Divergence\\n\\n**Challenge Detail:**\\nWith perfect predictive accuracy, the \"optimal\" path for any individual β career, education, relationships, health, lifestyle β becomes definitively known. Society naturally and logically gravitates towards these optimal paths, as deviating would be seen as inefficient, irrational, or even irresponsible, leading to demonstrably worse outcomes. This creates immense societal pressure to conform to one\\'s predicted optimal trajectory. The consequence is a profound devaluation of *divergent, suboptimal, or purely serendipitous* choices. Accidental discoveries, \"unprofitable\" hobbies that lead to unexpected personal growth, relationships that defy statistical odds but bring immense happiness, careers chosen for passion over predicted success β these might be suppressed or viewed as wasteful. Human flourishing thrives on variety, serendipity, and the freedom to experiment, even if it leads to perceived \"inefficiency\" or \"failure.\" A society where every choice is perfectly rational and optimal risks becoming sterile, homogenous, and stifling of the unique, sometimes illogical, forms of human expression and experience that enrich collective existence. The true value of an \"inefficient\" path that leads to unexpected wisdom, resilience, or a novel perspective could be lost.\\n\\n**Non-Obvious Societal Mechanism: \"The Serendipity Dividend\" and \"Narrative Curators\"**\\n\\nAethel implements a \"Serendipity Dividend\" β a robust and prestigious societal program that actively funds, supports, and celebrates paths and projects specifically identified by the Chronos Engine as *non-optimal* or *divergent* from an individual\\'s predicted peak efficiency or success. This isn\\'t just welfare; it\\'s a *deliberate investment* in human experiential diversity. Individuals who choose to consciously deviate from their predicted optimal path (e.g., an individual predicted to be a brilliant engineer choosing to pursue abstract art, or one predicted to remain single opting for a complex, statistically challenging relationship) are eligible for significant societal resources, mentorship, and public recognition.\\n\\nFurthermore, \"Narrative Curators\" are established as a respected profession. These individuals, using the Chronos Engine, identify and document the unique, unexpected, and often \"suboptimal\" journeys and their profound, often unpredictable, benefits to the individual and society. They create public narratives celebrating these choices, highlighting the wisdom gained from struggle, the beauty of the unexpected, and the novel insights that only arise from paths less traveled. This actively elevates the social status of divergence and serendipity.\\n\\n**Justification:** This mechanism directly counteracts the pressure to conform to \"the optimal.\" It institutionalizes the value of inefficiency, exploration, and unique personal journeys, recognizing that true flourishing encompasses more than just maximized outcomes. By providing resources and social prestige to those who choose divergent paths, it encourages a rich tapestry of human experience, fostering innovation, resilience, and a deeper understanding of human potential that might otherwise be overlooked by pure optimization. It preserves the vital human desire to explore, experiment, and define one\\'s own path, even when a \"better\" one is known.\\n\\n---\\n\\n### Non-Obvious Challenge 3: The Predetermined Self and the Crisis of Genuine Connection\\n\\n**Challenge Detail:**\\nIf every future thought, feeling, and action of an individual is known to everyone, it creates a profound crisis of authenticity and genuine connection. How can trust be built if every future betrayal or affirmation is already public knowledge? How can empathy truly develop if one already knows the precise nature and duration of another\\'s suffering or joy? Vulnerability, often key to deep human bonds, loses its meaning if there are no true unknowns to reveal. Individuals might feel they are merely acting out a script, not truly *being* themselves, but rather performing a known future. This impacts self-perception, leading to an \"existential echo chamber\" where one\\'s self-image is constantly reflected back as a predetermined entity. The very spontaneity and unburdened sincerity crucial for developing genuine love, friendship, or even professional collaboration is undermined, as every interaction is tinged with the foreknowledge of its precise trajectory and outcome. The effort of truly listening, empathizing, or forgiving diminishes if the exact resolution is already known.\\n\\n**Non-Obvious Societal Mechanism: \"Prognostic Embodiment\" and \"Shared Unfolding Pods\"**\\n\\nAethel develops \"Prognostic Embodiment\" experiences. These are not merely data readouts, but highly advanced, consensual, immersive simulations powered by the Chronos Engine, allowing individuals to temporarily *experience* the predicted future actions, motivations, and emotional states of others (or even their past selves at different developmental stages). This provides a far deeper form of empathy than mere intellectual knowledge. For example, a parent could experience their teenage child\\'s predicted rebellious phase and its underlying anxieties, allowing them to approach it with pre-emptive understanding rather than reaction. This transforms foreknowledge from a barrier to a bridge of radical empathy.\\n\\nFurthermore, \"Shared Unfolding Pods\" are established. These are carefully curated, small, and private groups where individuals, knowing each other\\'s full life prognoses, commit to a radical form of \"process-based authenticity.\" The focus shifts from the \"what\" (which is known) to the \"how\" and \"why\" β specifically, *how* each person will consciously navigate their known future, *why* they anticipate specific emotional responses, and *how* the group will collectively support each other through those predetermined events. Authenticity in these pods lies not in the revelation of an unknown future, but in the vulnerable, real-time sharing of one\\'s internal experience *of living out* a known future. The effort of connection becomes about the shared emotional journey through predestination, offering mutual validation and support within a fully transparent framework.\\n\\n**Justification:** This mechanism redefines the basis of genuine connection and authenticity in a world without secrets. Prognostic Embodiment transforms abstract data into visceral understanding, fostering a deeper, more profound form of empathy than previously possible. Shared Unfolding Pods, meanwhile, shift the focus of authenticity from revealing unknown facets of self to transparently sharing one\\'s internal navigation of a known destiny. It allows for a new kind of trust and intimacy, born not from ignorance but from a shared, deep understanding of each other\\'s pre-written paths and the human experience of living them out. It transforms the burden of the predetermined self into a unique opportunity for unparalleled collective consciousness and emotional resonance.\\n\\n\\n\\nNow 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_messages)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Judgement time!\n",
"\n",
"openai = OpenAI()\n",
"response = openai.chat.completions.create(\n",
" model=\"gpt-5-mini\",\n",
" messages=judge_messages,\n",
")\n",
"results = response.choices[0].message.content\n",
"print(results)\n"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\"results\": [\"1\"]}\n"
]
}
],
"source": [
"gemini = OpenAI(api_key=google_api_key, base_url=\"https://generativelanguage.googleapis.com/v1beta/openai/\")\n",
"model_name = \"gemini-2.5-flash\"\n",
"response = gemini.chat.completions.create(\n",
" model=model_name,\n",
" messages = judge_messages,\n",
")\n",
"results = response.choices[0].message.content\n",
"print(results)"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Rank 1: gemini-2.5-flash\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.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
|