Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse filesFiles changed (7)
- .gitattributes+1
- 1_lab1.ipynb+12-30
- 4_lab4.ipynb+35-6
- 5_extra.ipynb+665-352
- me/linkedin.pdf
- me/linkedin__old.pdfAdded
- me/summary.txt+1-16
41 unmodified lines42434441 unmodified linescommunity_contributions/NLP_Agent_Dinesh_Uthayakumar/eval2_money_customers_owe.wav filter=lfs diff=lfs merge=lfs -textcommunity_contributions/NLP_Agent_Dinesh_Uthayakumar/eval3_total_estimated_revenue.wav filter=lfs diff=lfs merge=lfs -textcommunity_contributions/seung-gu/me/linkedin.pdf filter=lfs diff=lfs merge=lfs -text41 unmodified lines4243444541 unmodified linescommunity_contributions/NLP_Agent_Dinesh_Uthayakumar/eval2_money_customers_owe.wav filter=lfs diff=lfs merge=lfs -textcommunity_contributions/NLP_Agent_Dinesh_Uthayakumar/eval3_total_estimated_revenue.wav filter=lfs diff=lfs merge=lfs -textcommunity_contributions/seung-gu/me/linkedin.pdf filter=lfs diff=lfs merge=lfs -textme/linkedin.pdf filter=lfs diff=lfs merge=lfs -text
261 unmodified lines26226326426526626726829 unmodified lines298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338261 unmodified lines"name": "stdout","output_type": "stream","text": ["If you have eight identical-looking balls, but one is slightly heavier and you have a balance scale that can be used only twice, how can you determine which ball is the heavier one?\n"]}],29 unmodified lines"name": "stdout","output_type": "stream","text": ["You have 8 balls, 1 of which is heavier, and a balance scale you can use only twice. The goal is to identify the heavier ball in just two weighings.\n","\n","### Step-by-step solution:\n","\n","1. **Divide the balls into 3 groups:**\n"," - Group A: 3 balls\n"," - Group B: 3 balls\n"," - Group C: 2 balls\n","\n","2. **First Weighing:**\n"," - Weigh Group A (3 balls) against Group B (3 balls).\n"," - **Possible outcomes:**\n"," - **A = B:** Both groups are equal in weight, so the heavier ball is in Group C.\n"," - **A ≠ B:** The heavier side contains the heavier ball.\n","\n","3. **Second Weighing:**\n"," - If the heavier ball is in Group C (2 balls), simply weigh one ball from Group C against the other:\n"," - Heavier pan → that ball is heavier.\n"," - If the heavier ball is in Group A or B (3 balls):\n"," - Take any 2 balls from the heavier group and weigh them against each other.\n"," - If one is heavier → identified.\n"," - If they balance → the ball not weighed in this step is the heavier ball.\n","\n","---\n","\n","### Summary:\n","\n","| Step | Action | Result |\n","|--------------------|----------------------------------------|---------------------------------------------|\n","| 1st Weighing | Weigh 3 vs 3 balls (Group A vs Group B) | If balanced → heavier ball in remaining 2 balls (Group C); else heavier side has the heavy ball |\n","| 2nd Weighing | Depending on 1st result: | |\n","| | - If heavy ball in Group C: weigh 2 balls against each other | Directly find heavier ball |\n","| | - If heavy ball in Group A/B: weigh 2 balls from heavy group | Heavier one identified or remaining ball is heavier |\n","\n","With this procedure, you can always find the single heavier ball in just 2 weighings.\n"]}],261 unmodified lines26226326426526626726829 unmodified lines298299300301302303304305306307308309310311312313314315316317318319320261 unmodified lines"name": "stdout","output_type": "stream","text": ["If a clock’s hour hand moves 0.5 degrees per minute, how many degrees will it have moved between 3:15 PM and 7:45 PM?\n"]}],29 unmodified lines"name": "stdout","output_type": "stream","text": ["The hour hand moves **0.5 degrees per minute**.\n","\n","**Step 1: Calculate the total time elapsed between 3:15 PM and 7:45 PM.**\n","\n","From 3:15 PM to 7:45 PM:\n","- Hours: 7 - 3 = 4 hours\n","- Minutes: 45 - 15 = 30 minutes\n","\n","Total time = 4 hours 30 minutes = (4 × 60) + 30 = 240 + 30 = 270 minutes\n","\n","**Step 2: Calculate the degrees moved by the hour hand**\n","\n","Degrees moved = (degrees per minute) × (total minutes) \n","= 0.5 degrees/minute × 270 minutes \n","= 135 degrees\n","\n","**Answer:** The hour hand will have moved **135 degrees** between 3:15 PM and 7:45 PM.\n"]}],
233 unmodified lines23423523623723823924013 unmodified lines25425525625725825926012 unmodified lines27327427527627727827911 unmodified lines29129229329429529629723 unmodified lines321322323324325326327328329233 unmodified lines},{"cell_type": "code","execution_count": null,"metadata": {},"outputs": [],"source": [13 unmodified lines},{"cell_type": "code","execution_count": null,"metadata": {},"outputs": [],"source": [12 unmodified lines},{"cell_type": "code","execution_count": null,"metadata": {},"outputs": [],"source": [11 unmodified lines},{"cell_type": "code","execution_count": null,"metadata": {},"outputs": [],"source": [23 unmodified lines},{"cell_type": "code","execution_count": null,"metadata": {},"outputs": [],"source": ["gr.ChatInterface(chat, type=\"messages\").launch()"]233 unmodified lines23423523623723823924013 unmodified lines25425525625725825926012 unmodified lines27327427527627727827911 unmodified lines29129229329429529629723 unmodified lines321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358233 unmodified lines},{"cell_type": "code","execution_count": 19,"metadata": {},"outputs": [],"source": [13 unmodified lines},{"cell_type": "code","execution_count": 20,"metadata": {},"outputs": [],"source": [12 unmodified lines},{"cell_type": "code","execution_count": 21,"metadata": {},"outputs": [],"source": [11 unmodified lines},{"cell_type": "code","execution_count": 22,"metadata": {},"outputs": [],"source": [23 unmodified lines},{"cell_type": "code","execution_count": 23,"metadata": {},"outputs": [{"name": "stdout","output_type": "stream","text": ["* Running on local URL: http://127.0.0.1:7861\n","* To create a public link, set `share=True` in `launch()`.\n"]},{"data": {"text/html": ["<div><iframe src=\"http://127.0.0.1:7861/\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"],"text/plain": ["<IPython.core.display.HTML object>"]},"metadata": {},"output_type": "display_data"},{"data": {"text/plain": []},"execution_count": 23,"metadata": {},"output_type": "execute_result"}],"source": ["gr.ChatInterface(chat, type=\"messages\").launch()"]
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352{"cells": [{"cell_type": "markdown","id": "802f392f","metadata": {},"source": ["# A little extra!\n","\n","## New addition to Week 1\n","\n","### The Unreasonable Effectiveness of the Agent Loop"]},{"cell_type": "markdown","id": "0c78e180","metadata": {},"source": ["# What is an Agent?\n","\n","## Three competing definitions\n","\n","1. AI systems that can do work for you independently - Sam Altman\n","\n","2. A system in which an LLM controls the workflow - Anthropic\n","\n","3. An LLM agent runs tools in a loop to achieve a goal\n","\n","## The third one is the new, emerging definition\n","\n","But what does it mean?\n","\n","Let's make it real."]},{"cell_type": "code","execution_count": null,"id": "566bdd9a","metadata": {},"outputs": [],"source": ["# Start with some imports - rich is a library for making formatted text output in the terminal\n","\n","from rich.console import Console\n","from dotenv import load_dotenv\n","from openai import OpenAI\n","import json\n","load_dotenv(override=True)"]},{"cell_type": "code","execution_count": null,"id": "8d38dcc2","metadata": {},"outputs": [],"source": ["def show(text):\n"," try:\n"," Console().print(text)\n"," except Exception:\n"," print(text)"]},{"cell_type": "code","execution_count": null,"id": "18f1952e","metadata": {},"outputs": [],"source": ["openai = OpenAI()"]},{"cell_type": "code","execution_count": null,"id": "e1517bf3","metadata": {},"outputs": [],"source": ["# Some lists!\n","\n","todos = []\n","completed = []"]},{"cell_type": "code","execution_count": null,"id": "d415a4f2","metadata": {},"outputs": [],"source": ["def get_todo_report() -> str:\n"," result = \"\"\n"," for index, todo in enumerate(todos):\n"," if completed[index]:\n"," result += f\"Todo #{index + 1}: [green][strike]{todo}[/strike][/green]\\n\"\n"," else:\n"," result += f\"Todo #{index + 1}: {todo}\\n\"\n"," show(result)\n"," return result"]},{"cell_type": "code","execution_count": null,"id": "7b842749","metadata": {},"outputs": [],"source": ["get_todo_report()"]},{"cell_type": "code","execution_count": null,"id": "ff5f01ca","metadata": {},"outputs": [],"source": ["def create_todos(descriptions: list[str]) -> str:\n"," todos.extend(descriptions)\n"," completed.extend([False] * len(descriptions))\n"," return get_todo_report()"]},{"cell_type": "code","execution_count": null,"id": "aa4d97e6","metadata": {},"outputs": [],"source": ["def mark_complete(index: int, completion_notes: str) -> str:\n"," if 1 <= index <= len(todos):\n"," completed[index - 1] = True\n"," else:\n"," return \"No todo at this index.\"\n"," Console().print(completion_notes)\n"," return get_todo_report()"]},{"cell_type": "code","execution_count": null,"id": "ef3b3a97","metadata": {},"outputs": [],"source": ["todos, completed = [], []\n","\n","create_todos([\"Buy groceries\", \"Finish extra lab\", \"Eat banana\"])"]},{"cell_type": "code","execution_count": null,"id": "a9721a5c","metadata": {},"outputs": [],"source": ["mark_complete(1, \"bought\")"]},{"cell_type": "code","execution_count": null,"id": "4159b046","metadata": {},"outputs": [],"source": ["create_todos_json = {\n"," \"name\": \"create_todos\",\n"," \"description\": \"Add new todos from a list of descriptions and return the full list\",\n"," \"parameters\": {\n"," \"type\": \"object\",\n"," \"properties\": {\n"," \"descriptions\": {\n"," 'type': 'array',\n"," 'items': {'type': 'string'},\n"," 'title': 'Descriptions'\n"," }\n"," },\n"," \"required\": [\"descriptions\"],\n"," \"additionalProperties\": False\n"," }\n","}"]},{"cell_type": "code","execution_count": null,"id": "36a453e9","metadata": {},"outputs": [],"source": ["mark_complete_json = {\n"," \"name\": \"mark_complete\",\n"," \"description\": \"Mark complete the todo at the given position (starting from 1) and return the full list\",\n"," \"parameters\": {\n"," 'properties': {\n"," 'index': {\n"," 'description': 'The 1-based index of the todo to mark as complete',\n"," 'title': 'Index',\n"," 'type': 'integer'\n"," },\n"," 'completion_notes': {\n"," 'description': 'Notes about how you completed the todo in rich console markup',\n"," 'title': 'Completion Notes',\n"," 'type': 'string'\n"," }\n"," },\n"," 'required': ['index', 'completion_notes'],\n"," 'type': 'object',\n"," 'additionalProperties': False\n"," }\n","}"]},{"cell_type": "code","execution_count": null,"id": "52fe4d76","metadata": {},"outputs": [],"source": ["tools = [{\"type\": \"function\", \"function\": create_todos_json},\n"," {\"type\": \"function\", \"function\": mark_complete_json}]"]},{"cell_type": "code","execution_count": null,"id": "af686232","metadata": {},"outputs": [],"source": ["def handle_tool_calls(tool_calls):\n"," results = []\n"," for tool_call in tool_calls:\n"," tool_name = tool_call.function.name\n"," arguments = json.loads(tool_call.function.arguments)\n"," tool = globals().get(tool_name)\n"," result = tool(**arguments) if tool else {}\n"," results.append({\"role\": \"tool\",\"content\": json.dumps(result),\"tool_call_id\": tool_call.id})\n"," return results"]},{"cell_type": "code","execution_count": null,"id": "20bebfee","metadata": {},"outputs": [],"source": ["def loop(messages):\n"," done = False\n"," while not done:\n"," response = openai.chat.completions.create(model=\"gpt-5.2\", messages=messages, tools=tools, reasoning_effort=\"none\")\n"," finish_reason = response.choices[0].finish_reason\n"," if finish_reason==\"tool_calls\":\n"," message = response.choices[0].message\n"," tool_calls = message.tool_calls\n"," results = handle_tool_calls(tool_calls)\n"," messages.append(message)\n"," messages.extend(results)\n"," else:\n"," done = True\n"," show(response.choices[0].message.content)"]},{"cell_type": "code","execution_count": null,"id": "839d1593","metadata": {},"outputs": [],"source": ["system_message = \"\"\"\n","You are given a problem to solve, by using your todo tools to plan a list of steps, then carrying out each step in turn.\n","Now use the todo list tools, create a plan, carry out the steps, and reply with the solution.\n","If any quantity isn't provided in the question, then include a step to come up with a reasonable estimate.\n","Provide your solution in Rich console markup without code blocks.\n","Do not ask the user questions or clarification; respond only with the answer after using your tools.\n","\"\"\"\n","user_message = \"\"\"\"\n","A train leaves Boston at 2:00 pm traveling 60 mph.\n","Another train leaves New York at 3:00 pm traveling 80 mph toward Boston.\n","When do they meet?\n","\"\"\"\n","messages = [{\"role\": \"system\", \"content\": system_message}, {\"role\": \"user\", \"content\": user_message}]"]},{"cell_type": "code","execution_count": null,"id": "fe6f4515","metadata": {},"outputs": [],"source": ["todos, completed = [], []\n","loop(messages)"]},{"cell_type": "markdown","id": "b9b3e1ed","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;\">Now try to build an Agent Loop from scratch yourself!<br/>\n"," Create a new .ipynb and make one from first principles, referring back to this as needed.<br/>\n"," It's one of the few times that I recommend typing from scratch - it's a very satisfying result.\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.9"}},"nbformat": 4,"nbformat_minor": 5}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665{"cells": [{"cell_type": "markdown","id": "802f392f","metadata": {},"source": ["# A little extra!\n","\n","## New addition to Week 1\n","\n","### The Unreasonable Effectiveness of the Agent Loop"]},{"cell_type": "markdown","id": "0c78e180","metadata": {},"source": ["# What is an Agent?\n","\n","## Three competing definitions\n","\n","1. AI systems that can do work for you independently - Sam Altman\n","\n","2. A system in which an LLM controls the workflow - Anthropic\n","\n","3. An LLM agent runs tools in a loop to achieve a goal\n","\n","## The third one is the new, emerging definition\n","\n","But what does it mean?\n","\n","Let's make it real."]},{"cell_type": "code","execution_count": 1,"id": "566bdd9a","metadata": {},"outputs": [{"data": {"text/plain": ["True"]},"execution_count": 1,"metadata": {},"output_type": "execute_result"}],"source": ["# Start with some imports - rich is a library for making formatted text output in the terminal\n","\n","from rich.console import Console\n","from dotenv import load_dotenv\n","from openai import OpenAI\n","import json\n","load_dotenv(override=True)"]},{"cell_type": "code","execution_count": 2,"id": "8d38dcc2","metadata": {},"outputs": [],"source": ["def show(text):\n"," try:\n"," Console().print(text)\n"," except Exception:\n"," print(text)"]},{"cell_type": "code","execution_count": 3,"id": "18f1952e","metadata": {},"outputs": [],"source": ["openai = OpenAI()"]},{"cell_type": "code","execution_count": 4,"id": "e1517bf3","metadata": {},"outputs": [],"source": ["# Some lists!\n","\n","todos = []\n","completed = []"]},{"cell_type": "code","execution_count": 5,"id": "d415a4f2","metadata": {},"outputs": [],"source": ["def get_todo_report() -> str:\n"," result = \"\"\n"," for index, todo in enumerate(todos):\n"," if completed[index]:\n"," result += f\"Todo #{index + 1}: [green][strike]{todo}[/strike][/green]\\n\"\n"," else:\n"," result += f\"Todo #{index + 1}: {todo}\\n\"\n"," show(result)\n"," return result"]},{"cell_type": "code","execution_count": 6,"id": "7b842749","metadata": {},"outputs": [{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n","</pre>\n"],"text/plain": ["\n"]},"metadata": {},"output_type": "display_data"},{"data": {"text/plain": ["''"]},"execution_count": 6,"metadata": {},"output_type": "execute_result"}],"source": ["get_todo_report()"]},{"cell_type": "code","execution_count": 7,"id": "ff5f01ca","metadata": {},"outputs": [],"source": ["def create_todos(descriptions: list[str]) -> str:\n"," todos.extend(descriptions)\n"," completed.extend([False] * len(descriptions))\n"," return get_todo_report()"]},{"cell_type": "code","execution_count": 8,"id": "aa4d97e6","metadata": {},"outputs": [],"source": ["def mark_complete(index: int, completion_notes: str) -> str:\n"," if 1 <= index <= len(todos):\n"," completed[index - 1] = True\n"," else:\n"," return \"No todo at this index.\"\n"," Console().print(completion_notes)\n"," return get_todo_report()"]},{"cell_type": "code","execution_count": 9,"id": "ef3b3a97","metadata": {},"outputs": [{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>: Buy groceries\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>: Finish extra lab\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>: Eat banana\n","\n","</pre>\n"],"text/plain": ["Todo #\u001b[1;36m1\u001b[0m: Buy groceries\n","Todo #\u001b[1;36m2\u001b[0m: Finish extra lab\n","Todo #\u001b[1;36m3\u001b[0m: Eat banana\n","\n"]},"metadata": {},"output_type": "display_data"},{"data": {"text/plain": ["'Todo #1: Buy groceries\\nTodo #2: Finish extra lab\\nTodo #3: Eat banana\\n'"]},"execution_count": 9,"metadata": {},"output_type": "execute_result"}],"source": ["todos, completed = [], []\n","\n","create_todos([\"Buy groceries\", \"Finish extra lab\", \"Eat banana\"])"]},{"cell_type": "code","execution_count": 10,"id": "a9721a5c","metadata": {},"outputs": [{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">bought\n","</pre>\n"],"text/plain": ["bought\n"]},"metadata": {},"output_type": "display_data"},{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>: <span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">Buy groceries</span>\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>: Finish extra lab\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>: Eat banana\n","\n","</pre>\n"],"text/plain": ["Todo #\u001b[1;36m1\u001b[0m: \u001b[9;32mBuy groceries\u001b[0m\n","Todo #\u001b[1;36m2\u001b[0m: Finish extra lab\n","Todo #\u001b[1;36m3\u001b[0m: Eat banana\n","\n"]},"metadata": {},"output_type": "display_data"},{"data": {"text/plain": ["'Todo #1: [green][strike]Buy groceries[/strike][/green]\\nTodo #2: Finish extra lab\\nTodo #3: Eat banana\\n'"]},"execution_count": 10,"metadata": {},"output_type": "execute_result"}],"source": ["mark_complete(1, \"bought\")"]},{"cell_type": "code","execution_count": 11,"id": "4159b046","metadata": {},"outputs": [],"source": ["create_todos_json = {\n"," \"name\": \"create_todos\",\n"," \"description\": \"Add new todos from a list of descriptions and return the full list\",\n"," \"parameters\": {\n"," \"type\": \"object\",\n"," \"properties\": {\n"," \"descriptions\": {\n"," 'type': 'array',\n"," 'items': {'type': 'string'},\n"," 'title': 'Descriptions'\n"," }\n"," },\n"," \"required\": [\"descriptions\"],\n"," \"additionalProperties\": False\n"," }\n","}"]},{"cell_type": "code","execution_count": 12,"id": "36a453e9","metadata": {},"outputs": [],"source": ["mark_complete_json = {\n"," \"name\": \"mark_complete\",\n"," \"description\": \"Mark complete the todo at the given position (starting from 1) and return the full list\",\n"," \"parameters\": {\n"," 'properties': {\n"," 'index': {\n"," 'description': 'The 1-based index of the todo to mark as complete',\n"," 'title': 'Index',\n"," 'type': 'integer'\n"," },\n"," 'completion_notes': {\n"," 'description': 'Notes about how you completed the todo in rich console markup',\n"," 'title': 'Completion Notes',\n"," 'type': 'string'\n"," }\n"," },\n"," 'required': ['index', 'completion_notes'],\n"," 'type': 'object',\n"," 'additionalProperties': False\n"," }\n","}"]},{"cell_type": "code","execution_count": 13,"id": "52fe4d76","metadata": {},"outputs": [],"source": ["tools = [{\"type\": \"function\", \"function\": create_todos_json},\n"," {\"type\": \"function\", \"function\": mark_complete_json}]"]},{"cell_type": "code","execution_count": 14,"id": "af686232","metadata": {},"outputs": [],"source": ["def handle_tool_calls(tool_calls):\n"," results = []\n"," for tool_call in tool_calls:\n"," tool_name = tool_call.function.name\n"," arguments = json.loads(tool_call.function.arguments)\n"," tool = globals().get(tool_name)\n"," result = tool(**arguments) if tool else {}\n"," results.append({\"role\": \"tool\",\"content\": json.dumps(result),\"tool_call_id\": tool_call.id})\n"," return results"]},{"cell_type": "code","execution_count": 15,"id": "20bebfee","metadata": {},"outputs": [],"source": ["def loop(messages):\n"," done = False\n"," while not done:\n"," response = openai.chat.completions.create(model=\"gpt-5.2\", messages=messages, tools=tools, reasoning_effort=\"none\")\n"," finish_reason = response.choices[0].finish_reason\n"," if finish_reason==\"tool_calls\":\n"," message = response.choices[0].message\n"," tool_calls = message.tool_calls\n"," results = handle_tool_calls(tool_calls)\n"," messages.append(message)\n"," messages.extend(results)\n"," else:\n"," done = True\n"," show(response.choices[0].message.content)"]},{"cell_type": "code","execution_count": 16,"id": "839d1593","metadata": {},"outputs": [],"source": ["system_message = \"\"\"\n","You are given a problem to solve, by using your todo tools to plan a list of steps, then carrying out each step in turn.\n","Now use the todo list tools, create a plan, carry out the steps, and reply with the solution.\n","If any quantity isn't provided in the question, then include a step to come up with a reasonable estimate.\n","Provide your solution in Rich console markup without code blocks.\n","Do not ask the user questions or clarification; respond only with the answer after using your tools.\n","\"\"\"\n","user_message = \"\"\"\"\n","A train leaves Boston at 2:00 pm traveling 60 mph.\n","Another train leaves New York at 3:00 pm traveling 80 mph toward Boston.\n","When do they meet?\n","\"\"\"\n","messages = [{\"role\": \"system\", \"content\": system_message}, {\"role\": \"user\", \"content\": user_message}]"]},{"cell_type": "code","execution_count": 17,"id": "fe6f4515","metadata": {},"outputs": [{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>: Parse the problem, set up variables <span style=\"font-weight: bold\">(</span>distance between Boston and New York<span style=\"font-weight: bold\">)</span> and meeting condition.\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>: Since distance isn’t provided, choose a reasonable estimate and note it <span style=\"font-weight: bold\">(</span>typical rail/road distance<span style=\"font-weight: bold\">)</span>.\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>: Compute travel times and solve for meeting time relative to departure times.\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>: Present the meeting time in clock time with clear explanation.\n","\n","</pre>\n"],"text/plain": ["Todo #\u001b[1;36m1\u001b[0m: Parse the problem, set up variables \u001b[1m(\u001b[0mdistance between Boston and New York\u001b[1m)\u001b[0m and meeting condition.\n","Todo #\u001b[1;36m2\u001b[0m: Since distance isn’t provided, choose a reasonable estimate and note it \u001b[1m(\u001b[0mtypical rail/road distance\u001b[1m)\u001b[0m.\n","Todo #\u001b[1;36m3\u001b[0m: Compute travel times and solve for meeting time relative to departure times.\n","Todo #\u001b[1;36m4\u001b[0m: Present the meeting time in clock time with clear explanation.\n","\n"]},"metadata": {},"output_type": "display_data"},{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Let <span style=\"font-weight: bold\">D</span> be the Boston–New York distance <span style=\"font-weight: bold\">(</span>miles<span style=\"font-weight: bold\">)</span>. Let <span style=\"font-weight: bold\">t</span> be hours after <span style=\"color: #00ff00; text-decoration-color: #00ff00; font-weight: bold\">2:00</span> pm when they meet. Boston train distance: \n","<span style=\"font-weight: bold\">60t</span>. New York train leaves <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span> hour later, so it travels <span style=\"font-weight: bold\">t-</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span> hours, distance <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">80</span><span style=\"font-weight: bold\">(t-</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span><span style=\"font-weight: bold\">)</span>. Meeting condition: <span style=\"font-weight: bold\">60t + </span>\n","<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">80</span><span style=\"font-weight: bold\">(t-</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span><span style=\"font-weight: bold\">) = D</span>.\n","</pre>\n"],"text/plain": ["Let \u001b[1mD\u001b[0m be the Boston–New York distance \u001b[1m(\u001b[0mmiles\u001b[1m)\u001b[0m. Let \u001b[1mt\u001b[0m be hours after \u001b[1;92m2:00\u001b[0m pm when they meet. Boston train distance: \n","\u001b[1m60t\u001b[0m. New York train leaves \u001b[1;36m1\u001b[0m hour later, so it travels \u001b[1mt-\u001b[0m\u001b[1;36m1\u001b[0m hours, distance \u001b[1;35m80\u001b[0m\u001b[1m(\u001b[0m\u001b[1mt-\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1m)\u001b[0m. Meeting condition: \u001b[1m60t + \u001b[0m\n","\u001b[1;35m80\u001b[0m\u001b[1m(\u001b[0m\u001b[1mt-\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1m)\u001b[0m\u001b[1m = D\u001b[0m.\n"]},"metadata": {},"output_type": "display_data"},{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>: <span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">Parse the problem, set up variables </span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">(</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">distance between Boston and New York</span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">)</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\"> and meeting condition.</span>\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>: Since distance isn’t provided, choose a reasonable estimate and note it <span style=\"font-weight: bold\">(</span>typical rail/road distance<span style=\"font-weight: bold\">)</span>.\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>: Compute travel times and solve for meeting time relative to departure times.\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>: Present the meeting time in clock time with clear explanation.\n","\n","</pre>\n"],"text/plain": ["Todo #\u001b[1;36m1\u001b[0m: \u001b[9;32mParse the problem, set up variables \u001b[0m\u001b[1;9;32m(\u001b[0m\u001b[9;32mdistance between Boston and New York\u001b[0m\u001b[1;9;32m)\u001b[0m\u001b[9;32m and meeting condition.\u001b[0m\n","Todo #\u001b[1;36m2\u001b[0m: Since distance isn’t provided, choose a reasonable estimate and note it \u001b[1m(\u001b[0mtypical rail/road distance\u001b[1m)\u001b[0m.\n","Todo #\u001b[1;36m3\u001b[0m: Compute travel times and solve for meeting time relative to departure times.\n","Todo #\u001b[1;36m4\u001b[0m: Present the meeting time in clock time with clear explanation.\n","\n"]},"metadata": {},"output_type": "display_data"},{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Distance isn’t given, so use a reasonable estimate: Boston ↔ New York is about <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">215</span><span style=\"font-weight: bold\"> miles</span> <span style=\"font-weight: bold\">(</span>commonly cited driving \n","distance; rail is similar order<span style=\"font-weight: bold\">)</span>. Set <span style=\"font-weight: bold\">D = </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">215</span>.\n","</pre>\n"],"text/plain": ["Distance isn’t given, so use a reasonable estimate: Boston ↔ New York is about \u001b[1;36m215\u001b[0m\u001b[1m miles\u001b[0m \u001b[1m(\u001b[0mcommonly cited driving \n","distance; rail is similar order\u001b[1m)\u001b[0m. Set \u001b[1mD = \u001b[0m\u001b[1;36m215\u001b[0m.\n"]},"metadata": {},"output_type": "display_data"},{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>: <span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">Parse the problem, set up variables </span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">(</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">distance between Boston and New York</span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">)</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\"> and meeting condition.</span>\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>: <span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">Since distance isn’t provided, choose a reasonable estimate and note it </span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">(</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">typical rail/road distance</span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">)</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">.</span>\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>: Compute travel times and solve for meeting time relative to departure times.\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>: Present the meeting time in clock time with clear explanation.\n","\n","</pre>\n"],"text/plain": ["Todo #\u001b[1;36m1\u001b[0m: \u001b[9;32mParse the problem, set up variables \u001b[0m\u001b[1;9;32m(\u001b[0m\u001b[9;32mdistance between Boston and New York\u001b[0m\u001b[1;9;32m)\u001b[0m\u001b[9;32m and meeting condition.\u001b[0m\n","Todo #\u001b[1;36m2\u001b[0m: \u001b[9;32mSince distance isn’t provided, choose a reasonable estimate and note it \u001b[0m\u001b[1;9;32m(\u001b[0m\u001b[9;32mtypical rail/road distance\u001b[0m\u001b[1;9;32m)\u001b[0m\u001b[9;32m.\u001b[0m\n","Todo #\u001b[1;36m3\u001b[0m: Compute travel times and solve for meeting time relative to departure times.\n","Todo #\u001b[1;36m4\u001b[0m: Present the meeting time in clock time with clear explanation.\n","\n"]},"metadata": {},"output_type": "display_data"},{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Solve <span style=\"font-weight: bold\">60t + </span><span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">80</span><span style=\"font-weight: bold\">(t-</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span><span style=\"font-weight: bold\">) = </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">215</span> ⇒ <span style=\"font-weight: bold\">60t + 80t - </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">80</span><span style=\"font-weight: bold\"> = </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">215</span> ⇒ <span style=\"font-weight: bold\">140t = </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">295</span> ⇒ <span style=\"font-weight: bold\">t = </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">295</span><span style=\"font-weight: bold\">/</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">140</span><span style=\"font-weight: bold\"> ≈ </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2.1071</span> hours after <span style=\"color: #00ff00; text-decoration-color: #00ff00; font-weight: bold\">2:00</span> pm.\n","Convert <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.1071</span> hr to minutes: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.1071</span><span style=\"font-weight: bold\">×</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">60</span><span style=\"font-weight: bold\"> ≈ </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">6.43</span> minutes. So meeting is about <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span><span style=\"font-weight: bold\"> hours </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">6</span><span style=\"font-weight: bold\"> minutes</span> after <span style=\"color: #00ff00; text-decoration-color: #00ff00; font-weight: bold\">2:00</span> pm.\n","</pre>\n"],"text/plain": ["Solve \u001b[1m60t + \u001b[0m\u001b[1;35m80\u001b[0m\u001b[1m(\u001b[0m\u001b[1mt-\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1m)\u001b[0m\u001b[1m = \u001b[0m\u001b[1;36m215\u001b[0m ⇒ \u001b[1m60t + 80t - \u001b[0m\u001b[1;36m80\u001b[0m\u001b[1m = \u001b[0m\u001b[1;36m215\u001b[0m ⇒ \u001b[1m140t = \u001b[0m\u001b[1;36m295\u001b[0m ⇒ \u001b[1mt = \u001b[0m\u001b[1;36m295\u001b[0m\u001b[1m/\u001b[0m\u001b[1;36m140\u001b[0m\u001b[1m ≈ \u001b[0m\u001b[1;36m2.1071\u001b[0m hours after \u001b[1;92m2:00\u001b[0m pm.\n","Convert \u001b[1;36m0.1071\u001b[0m hr to minutes: \u001b[1;36m0.1071\u001b[0m\u001b[1m×\u001b[0m\u001b[1;36m60\u001b[0m\u001b[1m ≈ \u001b[0m\u001b[1;36m6.43\u001b[0m minutes. So meeting is about \u001b[1;36m2\u001b[0m\u001b[1m hours \u001b[0m\u001b[1;36m6\u001b[0m\u001b[1m minutes\u001b[0m after \u001b[1;92m2:00\u001b[0m pm.\n"]},"metadata": {},"output_type": "display_data"},{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>: <span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">Parse the problem, set up variables </span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">(</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">distance between Boston and New York</span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">)</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\"> and meeting condition.</span>\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>: <span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">Since distance isn’t provided, choose a reasonable estimate and note it </span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">(</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">typical rail/road distance</span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">)</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">.</span>\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>: <span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">Compute travel times and solve for meeting time relative to departure times.</span>\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>: Present the meeting time in clock time with clear explanation.\n","\n","</pre>\n"],"text/plain": ["Todo #\u001b[1;36m1\u001b[0m: \u001b[9;32mParse the problem, set up variables \u001b[0m\u001b[1;9;32m(\u001b[0m\u001b[9;32mdistance between Boston and New York\u001b[0m\u001b[1;9;32m)\u001b[0m\u001b[9;32m and meeting condition.\u001b[0m\n","Todo #\u001b[1;36m2\u001b[0m: \u001b[9;32mSince distance isn’t provided, choose a reasonable estimate and note it \u001b[0m\u001b[1;9;32m(\u001b[0m\u001b[9;32mtypical rail/road distance\u001b[0m\u001b[1;9;32m)\u001b[0m\u001b[9;32m.\u001b[0m\n","Todo #\u001b[1;36m3\u001b[0m: \u001b[9;32mCompute travel times and solve for meeting time relative to departure times.\u001b[0m\n","Todo #\u001b[1;36m4\u001b[0m: Present the meeting time in clock time with clear explanation.\n","\n"]},"metadata": {},"output_type": "display_data"},{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Add <span style=\"color: #00ff00; text-decoration-color: #00ff00; font-weight: bold\">2:06</span> <span style=\"font-weight: bold\">(</span>approx<span style=\"font-weight: bold\">)</span> to <span style=\"color: #00ff00; text-decoration-color: #00ff00; font-weight: bold\">2:00</span> pm ⇒ <span style=\"font-weight: bold\">about </span><span style=\"color: #00ff00; text-decoration-color: #00ff00; font-weight: bold\">4:06</span><span style=\"font-weight: bold\"> pm</span>.\n","</pre>\n"],"text/plain": ["Add \u001b[1;92m2:06\u001b[0m \u001b[1m(\u001b[0mapprox\u001b[1m)\u001b[0m to \u001b[1;92m2:00\u001b[0m pm ⇒ \u001b[1mabout \u001b[0m\u001b[1;92m4:06\u001b[0m\u001b[1m pm\u001b[0m.\n"]},"metadata": {},"output_type": "display_data"},{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>: <span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">Parse the problem, set up variables </span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">(</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">distance between Boston and New York</span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">)</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\"> and meeting condition.</span>\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>: <span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">Since distance isn’t provided, choose a reasonable estimate and note it </span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">(</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">typical rail/road distance</span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold; text-decoration: line-through\">)</span><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">.</span>\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>: <span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">Compute travel times and solve for meeting time relative to departure times.</span>\n","Todo #<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>: <span style=\"color: #008000; text-decoration-color: #008000; text-decoration: line-through\">Present the meeting time in clock time with clear explanation.</span>\n","\n","</pre>\n"],"text/plain": ["Todo #\u001b[1;36m1\u001b[0m: \u001b[9;32mParse the problem, set up variables \u001b[0m\u001b[1;9;32m(\u001b[0m\u001b[9;32mdistance between Boston and New York\u001b[0m\u001b[1;9;32m)\u001b[0m\u001b[9;32m and meeting condition.\u001b[0m\n","Todo #\u001b[1;36m2\u001b[0m: \u001b[9;32mSince distance isn’t provided, choose a reasonable estimate and note it \u001b[0m\u001b[1;9;32m(\u001b[0m\u001b[9;32mtypical rail/road distance\u001b[0m\u001b[1;9;32m)\u001b[0m\u001b[9;32m.\u001b[0m\n","Todo #\u001b[1;36m3\u001b[0m: \u001b[9;32mCompute travel times and solve for meeting time relative to departure times.\u001b[0m\n","Todo #\u001b[1;36m4\u001b[0m: \u001b[9;32mPresent the meeting time in clock time with clear explanation.\u001b[0m\n","\n"]},"metadata": {},"output_type": "display_data"},{"data": {"text/html": ["<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">Let</span> <span style=\"font-weight: bold\">D</span> be the Boston–New York distance. Since it isn’t given, use a reasonable estimate <span style=\"font-weight: bold\">D ≈ </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">215</span><span style=\"font-weight: bold\"> miles</span>.\n","\n","<span style=\"font-weight: bold\">Let</span> <span style=\"font-weight: bold\">t</span> = hours after <span style=\"color: #00ff00; text-decoration-color: #00ff00; font-weight: bold\">2:00</span> pm when they meet.\n","\n","- Boston train travels: <span style=\"font-weight: bold\">60t</span>\n","- New York train leaves at <span style=\"color: #00ff00; text-decoration-color: #00ff00; font-weight: bold\">3:00</span> pm, so it travels <span style=\"font-weight: bold\">t−</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span> hours: <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">80</span><span style=\"font-weight: bold\">(t−</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span><span style=\"font-weight: bold\">)</span>\n","\n","They meet when distances add to <span style=\"font-weight: bold\">D</span>:\n","<span style=\"font-weight: bold\">60t + </span><span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">80</span><span style=\"font-weight: bold\">(t−</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span><span style=\"font-weight: bold\">) = </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">215</span> \n","<span style=\"font-weight: bold\">140t − </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">80</span><span style=\"font-weight: bold\"> = </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">215</span> \n","<span style=\"font-weight: bold\">140t = </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">295</span> \n","<span style=\"font-weight: bold\">t = </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">295</span><span style=\"font-weight: bold\">/</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">140</span><span style=\"font-weight: bold\"> ≈ </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2.107</span><span style=\"font-weight: bold\"> hours</span> = <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span><span style=\"font-weight: bold\"> hours </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">6.4</span><span style=\"font-weight: bold\"> minutes</span>\n","\n","<span style=\"font-weight: bold\">Meeting time:</span> about <span style=\"color: #00ff00; text-decoration-color: #00ff00; font-weight: bold\">4:06</span><span style=\"font-weight: bold\"> pm</span>.\n","</pre>\n"],"text/plain": ["\u001b[1mLet\u001b[0m \u001b[1mD\u001b[0m be the Boston–New York distance. Since it isn’t given, use a reasonable estimate \u001b[1mD ≈ \u001b[0m\u001b[1;36m215\u001b[0m\u001b[1m miles\u001b[0m.\n","\n","\u001b[1mLet\u001b[0m \u001b[1mt\u001b[0m = hours after \u001b[1;92m2:00\u001b[0m pm when they meet.\n","\n","- Boston train travels: \u001b[1m60t\u001b[0m\n","- New York train leaves at \u001b[1;92m3:00\u001b[0m pm, so it travels \u001b[1mt−\u001b[0m\u001b[1;36m1\u001b[0m hours: \u001b[1;35m80\u001b[0m\u001b[1m(\u001b[0m\u001b[1mt−\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1m)\u001b[0m\n","\n","They meet when distances add to \u001b[1mD\u001b[0m:\n","\u001b[1m60t + \u001b[0m\u001b[1;35m80\u001b[0m\u001b[1m(\u001b[0m\u001b[1mt−\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1m)\u001b[0m\u001b[1m = \u001b[0m\u001b[1;36m215\u001b[0m \n","\u001b[1m140t − \u001b[0m\u001b[1;36m80\u001b[0m\u001b[1m = \u001b[0m\u001b[1;36m215\u001b[0m \n","\u001b[1m140t = \u001b[0m\u001b[1;36m295\u001b[0m \n","\u001b[1mt = \u001b[0m\u001b[1;36m295\u001b[0m\u001b[1m/\u001b[0m\u001b[1;36m140\u001b[0m\u001b[1m ≈ \u001b[0m\u001b[1;36m2.107\u001b[0m\u001b[1m hours\u001b[0m = \u001b[1;36m2\u001b[0m\u001b[1m hours \u001b[0m\u001b[1;36m6.4\u001b[0m\u001b[1m minutes\u001b[0m\n","\n","\u001b[1mMeeting time:\u001b[0m about \u001b[1;92m4:06\u001b[0m\u001b[1m pm\u001b[0m.\n"]},"metadata": {},"output_type": "display_data"}],"source": ["todos, completed = [], []\n","loop(messages)"]},{"cell_type": "markdown","id": "b9b3e1ed","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;\">Now try to build an Agent Loop from scratch yourself!<br/>\n"," Create a new .ipynb and make one from first principles, referring back to this as needed.<br/>\n"," It's one of the few times that I recommend typing from scratch - it's a very satisfying result.\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": 5}
12345678910111213141516Results-driven IT professional with 18+ years of experience leadingfull-stack software development across enterprise HR, financial, anddigital transformation initiatives. Proven track record in designingand delivering secure, scalable .NET applications using ASP.NETCore, Web APIs, microservices, and Azure. Skilled in front-endtechnologies like Angular, React, Flutter, and AI/ML.NET for modernweb and mobile solutions.Adept at leading cross-functional teams, aligning technical &Digitalization solutions with business strategy, and mentoringdevelopers to achieve delivery excellence. Hands-on in databasedesign, UI/UX optimiza-tion, API integration, and Agile SDLCmethodologies.Strong expertise in DevOps adoption, CI/CD automation, and PowerBI-driven data analytics to enhance operational decision-making.Thrive in leadership roles demanding both deep technical skills andstrategic oversight.1Senior technology leader with 19+ years of progressive experience in enterprise application portfolio management, AI-driven digital transformation, and large-scale system modernization. Expertise spanning utilities, healthcare, manufacturing, and government sectors. Proven track record aligning technology investments with measurable business outcomes, optimizing operational costs, and building and mentoring high-performance teams. Certified PMP, ITIL v4, CEH professional with deep expertise in enterprise architecture, IT governance, DevOps transformation, cloud platforms, and cybersecurity.
.gitattributes+1
1_lab1.ipynb+12-30
4_lab4.ipynb+35-6
5_extra.ipynb+665-352
me/linkedin.pdf
me/linkedin__old.pdfAdded
me/summary.txt+1-16