From ee8a043bcfcd53712a40e6b50b57894f40409b79 Mon Sep 17 00:00:00 2001 From: Tommy Date: Mon, 22 Sep 2025 12:20:41 +0100 Subject: [PATCH] make `ModelResponse` objects deterministic --- cachy.jsonl | 14 +++ nbs/00_core.ipynb | 289 ++++++++++++++++++++++++++-------------------- 2 files changed, 177 insertions(+), 126 deletions(-) diff --git a/cachy.jsonl b/cachy.jsonl index e344a17..213fac0 100644 --- a/cachy.jsonl +++ b/cachy.jsonl @@ -61,3 +61,17 @@ {"key": "c1d544c9", "response": "{\"id\":\"msg_01HF5UAE8tHxUY9LaAi4QHer\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-sonnet-4-20250514\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"The user is asking me to add 5 + 3. I have access to a simple_add function that can add two numbers together. Let me check the parameters:\\n- a: first operand (required) - this would be 5\\n- b: second operand (default 0, optional) - this would be 3\\n\\nI have both values needed, so I can call the function.\",\"signature\":\"EtcDCkYIBxgCKkBsQpKkRzBiOdz/WsOaqhfLGR5Ek0wqybtz7oGGXAeA3v3R5xaFWOGSV2FqryJ8GFGwXVwi72lf159aKHKEeFegEgznHzdwjcISQRbx+AgaDAHewzC+gZsxWSyOviIwZ5a/EK+wqk6VMo2ul4EIY62/bK54isjBzFYYyN5oAuVYdkyClXYN713Z5Blp+jKfKr4CiNIHa9Hwy/7UK6L8S4rY/YF7rJvu2kZlz8wF5W8Vvl8VNHQHgeNygMgoXAamixxGPIgB98kR5cmY6IcVym0MMmQA4r4RxcAf8NjRdyksYB3Y4mszWr6Edtnr8v4BPjr3fQtxgOQVjiEXsMKKmNVJBGikVksm3r7x/1EDJ+rs+jI6WHCUWoNOEmu5XbrAqHDf06SmkrhF9NKvVC8rqQWi9hB5LEPR8oWsgpxHivdlbVmJqT7WV+V5779TmESIvBGl4aor1SSWM0muYh3pDY9n1wSY4DQvVQPM3bavZZJo9rvH39EA093Q6zSZhBFDII+QRN7O77rjSf9XVumOF09xtsHye8HKhjsYJfvPAOV2+NEthD3jYZI+rrBEHqkyLgnNaLlExxByTNxMytXlTIc42cB1FSDOJoXzd62pPdHVGAE=\"},{\"type\":\"tool_use\",\"id\":\"toolu_01QBLkGLtd85Yj8eEiFVBu4v\",\"name\":\"simple_add\",\"input\":{\"a\":5,\"b\":3}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":455,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":165,\"service_tier\":\"standard\"}}"} {"key": "be2f6923", "response": "{\"id\":\"msg_01PTFqJ6zDquGC9GHZuyEd5P\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-sonnet-4-20250514\",\"content\":[{\"type\":\"text\",\"text\":\"5 + 3 = 8\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":633,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":12,\"service_tier\":\"standard\"}}"} {"key": "2537e9c9", "response": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01NFGV3p7tPW4U4ywcJkEYgu\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-sonnet-4-20250514\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":56,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":2,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\",\"signature\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"For\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" sorting 1000 random integers, I\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" need to consider what \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"most efficient\\\" means and what algorithms\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" would work best for\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" this size and type of data.\\n\\nFor\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" 1000 elements:\\n- This\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" is a medium-sized dataset\\n- The\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" integers are random\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" (no\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" particular order/pattern to\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" exploit\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\")\\n\\nKey\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" algorithms to consider:\\n1. Quick\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"sort -\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" O(n log n) average case\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\", but O(n\u00b2) worst case\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"\\n2. Mergesort - O\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"(n log n) guarantee\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"d, stable\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"\\n3. Heapsort -\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" O(n log n) guarantee\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"d\\n4. Int\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"rosort (\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"hybrid) - O(n log n) guarantee\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"d\\n5. Ti\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"msort - O(n log\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" n), optim\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"ized for real-world data\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"\\n6. Ra\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"dix sort - O(k\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"n) where k is number of digits\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\", but only\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" for integers\\n\\nFor 1000 \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"random integers, the most\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" practical choices\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" would be:\\n- Use\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" the built-in sort\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" function of your\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" programming language (usually\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" highly optimized)\\n- If\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" implementing from scratch, quick\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"sort or introsort would be goo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"d choices\\n-\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" Radix sort coul\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"d be very efficient\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" for integers specifically\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"\\n\\nBut the\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" question asks for the \\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"most efficient way\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" - in practice\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\", this would almost always be using\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" the built-in sorting\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" function of your programming language.\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"signature_delta\",\"signature\":\"EtYJCkYIBxgCKkAvzQCOVb6GaFEqenB9AiTB9TxKj6q1CPnyBIABpxZqBxQ7ijdMIylLCBpk8KORgVJi9G/DRAJVGDrs2KkcIGE+Egxp3xTzGj4YcKT/vYAaDJ1camYP0+M4q43OCCIwyw9GcNyISBHYwjtR6H9QUD+Fpxht44DgyJ9VuBCQOpPcgiNmH88n6H+sa7SW4McxKr0IItFNJh1YUXBInS6d/yNiFzEf2q5ZIHOd1ytWig+LnDWh+fDg8gYOwMqTLmEwWsDxu1j9Lg2zZYGiJQCq1hOeu3GjFcdyt7/6UsljFSj53zcmqegRzMlM7tVPPIx2Z61NxeoKov1/iQockAAsr22EYh9j9kiHq7Sf7fbm3Qcdht+qdUawDKj5Nn9JO9i8HLxX6z4J+sUa/wdDphFpabuhhF1VNL7YjOq0Nr4Yv7OhZOkBgiSjTHLXWTgVaeTvc4s8lr0vatFM7IlvDjpafauyKZDR4wsvHX8UvPTbora/eKBihcZ9ythO5upcqtDTT41gO3pB1R9DbP/rPva+gRGArQ8uOIFpHEkZd8BetYNIBoYK4meme1qREVQQqByc9Cr3TgKfgLPduLmGidosfUs5ljoj2YTxFm03rNlAwWg2mZgU66G2I6bdIkxGFd/TZmpi6lQwRCkZjgxKIj/8X9h/J5I4tjc1VupjLjD1cUnkb9zSk4lmDN+K3qQMluo0QBLni7eJxYcqlq3UoL4hOqraI9qcxjy6r+1UkZjHZ8wmvacRrRNHyxyU2zxyozPlDp/JGcYU57TQM4Wb2t850iKfQC3ozWlZPizN2vTRQKuaoSmGfV22z++XXYOiHtC/uP/obagH1fZk3J/5rjg1uP8X80/fk0s8E4iYMisIZLy0/rNHG/PW8w+sQVRkBGENiHA3KmMX6KeEV2XrIkwLMkuut94ATkQFLfU7Eh3y0iNBE3CIeu4vX02fQAgi1mTHTf8sdRWPklFF19ADW4bG7ejtTV8D7g6pBuPo3O+y8ttYtlgdzaXUM4Rc8jescW1j03jVqdmJxV+RcP/fbhTg6cC8kiP6jDnMHWVvPcRc7fQogk8aSmARithMu+xP5tkncUDpT3VRpnZ1QD3tlT93BTCHxOeIzURilWk4XAni3Dw6gLsOK9GK/cKyBKVxMLJz20VuEyWZeNRGphV/AuRNowppmQUjjiwVydf4agpeAw/IwqtQNqigtqPJqS/rXrdtKWksXf0RResQ5PI4PAN9iGWU+6xXYZUU5IsJWGuwgENZsfAruep5JtuoAE8b1193isNlT37nqjhzM8O1GA4LN9d67e/8w4vO+ZVrDr1aXoVfccYFaIhAm0SdYW4Gg6piprE9sTCPupxlMU7mYwrRhP5pq0xF0jkWFkVS9kmpiTp3zvVYQraOSRA7lrrJ2olNFiZZSe0x6ju/4sd5oORGuE080Bae3cBgs/2IqEZP/BjpeXnmab5Kj6E5aXJKNIonkpzM/X9EFPBiDwxQvx0BBxw8lMb4yHDOYLgS7u98QSOzA1eT0Q5gW1LcLgnD6ms038QatTHwXwWbYTc6tB28oaQYBI4jV4ASRv0u1HMPrfw1wyxekz/6xD2TM4SLU/V4Jy2GWDR7JMumYJNSkWlLFgAHICvsCFMf0jDqu3SBxnUYAQ==\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\"For 1000 random integers,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" the **most efficient approach\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" is to use your\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" programming language's built-in sort\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" function** (like `\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\"sort()` in Python, `Arrays\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\".sort()` in Java, or\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" `std::sort()` in C++).\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\n\\nThese implementations typically use highly\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" optimized hybrid algorithms like:\\n- **Int\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\"rosort** (intr\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\"ospective sort) - starts\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" with quicksort,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" switches to heapsort for\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" worst-case scenarios\\n- **Timsort**\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" (Python) - optim\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\"ized for real-world data patterns\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\n\\nIf implementing from scratch, **quicksort**\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" would be most\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" efficient for\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" random data at this\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" size, with\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" O(n log n) average performance\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\".\\n\\nFor integers\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" specifically, **radix sort** coul\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\"d also be very fast\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" (O(kn) where k is\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" the number of digits), but built\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\"-in functions are still\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" usually the best\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" choice due to their optimization\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\" and testing\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\".\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":56,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":499} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n"} +{"key": "c02616f6", "response": "{\"id\":\"msg_01VKbBwq8uVKBv3KrgxLzwnn\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-sonnet-4-20250514\",\"content\":[{\"type\":\"text\",\"text\":\"5 + 3 = 8\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":527,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":12,\"service_tier\":\"standard\"}}"} +{"key": "6945d727", "response": "{\n \"id\": \"chatcmpl-CIYs4i0cN9l4FXJO6d6cDZsjMniX0\",\n \"object\": \"chat.completion\",\n \"created\": 1758539984,\n \"model\": \"gpt-4.1-2025-04-14\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_Hsv5xQvJEpan8ZNoZfV9BAEC\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"simple_add\",\n \"arguments\": \"{\\\"a\\\":5,\\\"b\\\":3}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 74,\n \"completion_tokens\": 18,\n \"total_tokens\": 92,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_daf5fcc80a\"\n}\n"} +{"key": "dfda4dba", "response": "{\n \"id\": \"chatcmpl-CIYs5l2NgnH493did4TEoBXruLoVp\",\n \"object\": \"chat.completion\",\n \"created\": 1758539985,\n \"model\": \"gpt-4.1-2025-04-14\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"5 + 3 equals 8.\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 101,\n \"completion_tokens\": 9,\n \"total_tokens\": 110,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_daf5fcc80a\"\n}\n"} +{"key": "8fc9ca79", "response": "{\"id\":\"msg_01JmwgPqRan3KY5HoZD65M1b\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-sonnet-4-20250514\",\"content\":[{\"type\":\"text\",\"text\":\"5 + 3 = 8\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":633,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":12,\"service_tier\":\"standard\"}}"} +{"key": "6f19897f", "response": "{\"id\":\"msg_015bufXwEnwKzDRei3nP77yG\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-sonnet-4-20250514\",\"content\":[{\"type\":\"text\",\"text\":\"Now I'll add 7 to that result (8 + 7):\"},{\"type\":\"tool_use\",\"id\":\"toolu_01WvdZWmMQ8A1uLytBp4g999\",\"name\":\"simple_add\",\"input\":{\"a\":8,\"b\":7}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":543,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":88,\"service_tier\":\"standard\"}}"} +{"key": "d210fba8", "response": "{\"id\":\"msg_01PpXMGzxuJ4gTsW5CYdchFe\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-sonnet-4-20250514\",\"content\":[{\"type\":\"text\",\"text\":\"Finally, I'll add 11 to that result (15 + 11):\"},{\"type\":\"tool_use\",\"id\":\"toolu_01EGKUGxjR6oELVhS5vdVFR7\",\"name\":\"simple_add\",\"input\":{\"a\":15,\"b\":11}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":644,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":89,\"service_tier\":\"standard\"}}"} +{"key": "669fbd9c", "response": "{\"id\":\"msg_01Dp8deQ5UFyMuMRQg65eZ4L\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-sonnet-4-20250514\",\"content\":[{\"type\":\"text\",\"text\":\"So working step by step:\\n- 5 + 3 = 8\\n- 8 + 7 = 15 \\n- 15 + 11 = 26\\n\\nTherefore, ((5 + 3) + 7) + 11 = **26**\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":746,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":68,\"service_tier\":\"standard\"}}"} +{"key": "816db5ae", "response": "{\n \"id\": \"chatcmpl-CIYsDRkssaGXK740C937jhypzduPu\",\n \"object\": \"chat.completion\",\n \"created\": 1758539993,\n \"model\": \"gpt-4.1-2025-04-14\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_jN5HxRoN9WjUfmAYotbHiPPy\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"simple_add\",\n \"arguments\": \"{\\\"a\\\": 5, \\\"b\\\": 3}\"\n }\n },\n {\n \"id\": \"call_fcQcY0ZX8Os84FTa4Gc6XEve\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"simple_add\",\n \"arguments\": \"{\\\"a\\\": 7, \\\"b\\\": 2}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 110,\n \"completion_tokens\": 52,\n \"total_tokens\": 162,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_daf5fcc80a\"\n}\n"} +{"key": "a68815c0", "response": "{\n \"id\": \"chatcmpl-CIYsEutT17v5mDg48oxEWtMew4Xbe\",\n \"object\": \"chat.completion\",\n \"created\": 1758539994,\n \"model\": \"gpt-4.1-2025-04-14\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_Uxq7VTqwF6lZ5zYSVBeuLkbM\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"multiply\",\n \"arguments\": \"{\\\"a\\\":8,\\\"b\\\":9}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 178,\n \"completion_tokens\": 17,\n \"total_tokens\": 195,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_daf5fcc80a\"\n}\n"} +{"key": "35dbc88e", "response": "{\n \"id\": \"chatcmpl-CIYsFbH4GSkbTdvAKt0WRuJjRNZbY\",\n \"object\": \"chat.completion\",\n \"created\": 1758539995,\n \"model\": \"gpt-4.1-2025-04-14\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"(5 + 3) = 8 and (7 + 2) = 9. Multiplying these together: 8 \u00d7 9 = 72.\\n\\nSo, (5 + 3) * (7 + 2) = 72.\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 203,\n \"completion_tokens\": 54,\n \"total_tokens\": 257,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_daf5fcc80a\"\n}\n"} +{"key": "36e52bfe", "response": "{\"id\":\"msg_01S6ZQVHWAzDQRFsfWrqfYf9\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-sonnet-4-20250514\",\"content\":[{\"type\":\"text\",\"text\":\"Step 2: Calculate (2 + 1)\"},{\"type\":\"tool_use\",\"id\":\"toolu_013tpBAJas7hV8qM5S3QGCHY\",\"name\":\"simple_add\",\"input\":{\"a\":2,\"b\":1}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":737,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":83,\"service_tier\":\"standard\"}}"} +{"key": "867ba927", "response": "{\"id\":\"msg_01PvBgCrUvYhgytk2oDyfEP2\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-sonnet-4-20250514\",\"content\":[{\"type\":\"text\",\"text\":\"So far, I've calculated the expressions inside the parentheses:\\n\\n**Step 1:** (10 + 5) = 15\\n**Step 2:** (2 + 1) = 3\\n\\nNow the expression becomes: (15 * 3) / 3\\n\\nNext, I need to:\\n- Step 3: Multiply 15 * 3\\n- Step 4: Divide that result by 3\\n\\nWould you like me to continue with the remaining steps?\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":847,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":111,\"service_tier\":\"standard\"}}"} +{"key": "ba053676", "response": "{\"id\":\"msg_014ayra2dNXDs6deLDsMZDQN\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-sonnet-4-20250514\",\"content\":[{\"type\":\"text\",\"text\":\"The result of 5 + 7 is 12.\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":528,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":17,\"service_tier\":\"standard\"}}"} +{"key": "8eca5cc3", "response": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01XCecQcu25AkxT6ygpyiN3E\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-sonnet-4-20250514\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":528,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":2,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"The result\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" of 5 + 7 is\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" 12.\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":528,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":17} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n"} diff --git a/nbs/00_core.ipynb b/nbs/00_core.ipynb index 7a1889f..819caa8 100644 --- a/nbs/00_core.ipynb +++ b/nbs/00_core.ipynb @@ -46,6 +46,7 @@ "metadata": {}, "outputs": [], "source": [ + "from litellm.types.utils import ModelResponseBase\n", "from fastcore.test import *\n", "from IPython.display import Image, Markdown\n", "from cachy import enable_cachy" @@ -61,6 +62,32 @@ "enable_cachy()" ] }, + { + "cell_type": "markdown", + "id": "e1dad185", + "metadata": {}, + "source": [ + "LiteLLM `ModelResponse` objects have `id` and `created_at` fields that are generated dynamically. Even when we use `cachy` to cache the LLM response these dynamic fields create diffs which makes code review more challenging. The patches below ensure that `id` and `created_at` fields are fixed and won't generate diffs." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b52fbe23", + "metadata": {}, + "outputs": [], + "source": [ + "@patch\n", + "def __init__(self: ModelResponseBase, id=None, created=None, *args, **kwargs): \n", + " self._orig___init__(id='chatcmpl-xxx', created=1000000000, *args, **kwargs)\n", + "\n", + "@patch\n", + "def __setattr__(self: ModelResponseBase, name, value):\n", + " if name == 'id': value = 'chatcmpl-xxx'\n", + " elif name == 'created': value = 1000000000\n", + " self._orig___setattr__(name, value)" + ] + }, { "cell_type": "markdown", "id": "69f20759", @@ -161,7 +188,7 @@ "\n", "
\n", "\n", - "- id: `CpLKaOi_CoWekdUPgfC6qQo`\n", + "- id: `chatcmpl-xxx`\n", "- model: `gemini-2.5-flash`\n", "- finish_reason: `stop`\n", "- usage: `Usage(completion_tokens=113, prompt_tokens=4, total_tokens=117, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=102, rejected_prediction_tokens=None, text_tokens=11), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=None, text_tokens=4, image_tokens=None))`\n", @@ -169,7 +196,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='CpLKaOi_CoWekdUPgfC6qQo', created=1758422567, model='gemini-2.5-flash', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Hey there yourself! How can I help you today?', role='assistant', tool_calls=None, function_call=None, images=[], thinking_blocks=[], provider_specific_fields=None))], usage=Usage(completion_tokens=113, prompt_tokens=4, total_tokens=117, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=102, rejected_prediction_tokens=None, text_tokens=11), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=None, text_tokens=4, image_tokens=None)), vertex_ai_grounding_metadata=[], vertex_ai_url_context_metadata=[], vertex_ai_safety_results=[], vertex_ai_citation_metadata=[])" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='gemini-2.5-flash', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Hey there yourself! How can I help you today?', role='assistant', tool_calls=None, function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=113, prompt_tokens=4, total_tokens=117, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=102, rejected_prediction_tokens=None, text_tokens=11), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=None, text_tokens=4, image_tokens=None)), vertex_ai_grounding_metadata=[], vertex_ai_url_context_metadata=[], vertex_ai_safety_results=[], vertex_ai_citation_metadata=[])" ] }, "metadata": {}, @@ -191,15 +218,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-ebcd262f-b437-4fb0-9741-779908973460`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=16, prompt_tokens=10, total_tokens=26, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=16, prompt_tokens=10, total_tokens=26, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-ebcd262f-b437-4fb0-9741-779908973460', created=1758422567, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Hello! Nice to meet you! How are you doing today?', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=16, prompt_tokens=10, total_tokens=26, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Hello! Nice to meet you! How are you doing today?', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=16, prompt_tokens=10, total_tokens=26, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "metadata": {}, @@ -221,7 +248,7 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-CGk0K97RqKKSH9PfLFacGXWcbnXBW`\n", + "- id: `chatcmpl-xxx`\n", "- model: `gpt-4.1-2025-04-14`\n", "- finish_reason: `stop`\n", "- usage: `Usage(completion_tokens=10, prompt_tokens=10, total_tokens=20, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None))`\n", @@ -229,7 +256,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-CGk0K97RqKKSH9PfLFacGXWcbnXBW', created=1758106124, model='gpt-4.1-2025-04-14', object='chat.completion', system_fingerprint='fp_daf5fcc80a', choices=[Choices(finish_reason='stop', index=0, message=Message(content='Hello! How can I help you today? 馃槉', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={})], usage=Usage(completion_tokens=10, prompt_tokens=10, total_tokens=20, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)), service_tier='default')" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='gpt-4.1-2025-04-14', object='chat.completion', system_fingerprint='fp_daf5fcc80a', choices=[Choices(finish_reason='stop', index=0, message=Message(content='Hello! How can I help you today? 馃槉', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={})], usage=Usage(completion_tokens=10, prompt_tokens=10, total_tokens=20, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)), service_tier='default')" ] }, "metadata": {}, @@ -325,7 +352,7 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-CH5KiKfjLweWhWMWjfBYRJ7WkjK1s`\n", + "- id: `chatcmpl-xxx`\n", "- model: `gpt-4.1-2025-04-14`\n", "- finish_reason: `stop`\n", "- usage: `Usage(completion_tokens=45, prompt_tokens=268, total_tokens=313, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None))`\n", @@ -333,7 +360,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-CH5KiKfjLweWhWMWjfBYRJ7WkjK1s', created=1758188112, model='gpt-4.1-2025-04-14', object='chat.completion', system_fingerprint='fp_daf5fcc80a', choices=[Choices(finish_reason='stop', index=0, message=Message(content='This image shows a cute, young puppy with brown and white fur lying on the grass. The puppy is next to a bush with small purple flowers. The scene looks bright and outdoorsy, suggesting a garden or yard setting.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={})], usage=Usage(completion_tokens=45, prompt_tokens=268, total_tokens=313, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)), service_tier='default')" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='gpt-4.1-2025-04-14', object='chat.completion', system_fingerprint='fp_daf5fcc80a', choices=[Choices(finish_reason='stop', index=0, message=Message(content='This image shows a cute, young puppy with brown and white fur lying on the grass. The puppy is next to a bush with small purple flowers. The scene looks bright and outdoorsy, suggesting a garden or yard setting.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={})], usage=Usage(completion_tokens=45, prompt_tokens=268, total_tokens=313, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)), service_tier='default')" ] }, "execution_count": null, @@ -530,15 +557,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-6a670ce9-00ec-4edc-85d9-bac1a788ea49`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=131, prompt_tokens=104, total_tokens=235, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=131, prompt_tokens=104, total_tokens=235, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-6a670ce9-00ec-4edc-85d9-bac1a788ea49', created=1758422568, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='This image shows an adorable puppy with distinctive brown and white markings on its face. The puppy appears to be a small breed, possibly a Cavalier King Charles Spaniel or similar breed, with fluffy reddish-brown and white fur. The puppy is positioned near some purple flowers (which look like small daisies or asters) and is sitting on grass. The setting appears to be outdoors in a garden area, creating a sweet, natural portrait of this very cute young dog. The puppy has dark eyes and the classic innocent, gentle expression that makes puppies so endearing.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=131, prompt_tokens=104, total_tokens=235, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='This image shows an adorable puppy with distinctive brown and white markings on its face. The puppy appears to be a small breed, possibly a Cavalier King Charles Spaniel or similar breed, with fluffy reddish-brown and white fur. The puppy is positioned near some purple flowers (which look like small daisies or asters) and is sitting on grass. The setting appears to be outdoors in a garden area, creating a sweet, natural portrait of this very cute young dog. The puppy has dark eyes and the classic innocent, gentle expression that makes puppies so endearing.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=131, prompt_tokens=104, total_tokens=235, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "execution_count": null, @@ -600,10 +627,11 @@ { "data": { "text/plain": [ - "[{'role': 'user', 'content': 'Hey!'},\n", - " {'role': 'assistant', 'content': 'Hi there!'},\n", - " {'role': 'user', 'content': 'How are you?'},\n", - " {'role': 'assistant', 'content': \"I'm doing fine and you?\"}]" + "[{'role': 'user', 'content': [{'type': 'text', 'text': 'Hey!'}]},\n", + " {'role': 'assistant', 'content': [{'type': 'text', 'text': 'Hi there!'}]},\n", + " {'role': 'user', 'content': [{'type': 'text', 'text': 'How are you?'}]},\n", + " {'role': 'assistant',\n", + " 'content': [{'type': 'text', 'text': \"I'm doing fine and you?\"}]}]" ] }, "execution_count": null, @@ -634,12 +662,19 @@ { "data": { "text/plain": [ - "[{'role': 'user', 'content': 'Tell me the weather in Paris and Rome'},\n", - " {'role': 'assistant', 'content': 'Assistant calls weather tool two times'},\n", - " {'role': 'tool', 'content': 'Weather in Paris is ...'},\n", - " {'role': 'tool', 'content': 'Weather in Rome is ...'},\n", - " {'role': 'assistant', 'content': 'Assistant returns weather'},\n", - " {'role': 'user', 'content': 'Thanks!'}]" + "[{'role': 'user',\n", + " 'content': [{'type': 'text',\n", + " 'text': 'Tell me the weather in Paris and Rome'}]},\n", + " {'role': 'assistant',\n", + " 'content': [{'type': 'text',\n", + " 'text': 'Assistant calls weather tool two times'}]},\n", + " {'role': 'tool',\n", + " 'content': [{'type': 'text', 'text': 'Weather in Paris is ...'}]},\n", + " {'role': 'tool',\n", + " 'content': [{'type': 'text', 'text': 'Weather in Rome is ...'}]},\n", + " {'role': 'assistant',\n", + " 'content': [{'type': 'text', 'text': 'Assistant returns weather'}]},\n", + " {'role': 'user', 'content': [{'type': 'text', 'text': 'Thanks!'}]}]" ] }, "execution_count": null, @@ -685,7 +720,7 @@ { "data": { "text/plain": [ - "[{'role': 'user', 'content': 'Hey'}]" + "[{'role': 'user', 'content': [{'type': 'text', 'text': 'Hey'}]}]" ] }, "execution_count": null, @@ -707,7 +742,7 @@ { "data": { "text/plain": [ - "[{'role': 'tool', 'content': 'fake tool result'}]" + "[{'role': 'tool', 'content': [{'type': 'text', 'text': 'fake tool result'}]}]" ] }, "execution_count": null, @@ -729,10 +764,11 @@ { "data": { "text/plain": [ - "[{'role': 'user', 'content': 'Hey!'},\n", - " {'role': 'assistant', 'content': 'Hi there!'},\n", - " {'role': 'user', 'content': 'How are you?'},\n", - " {'role': 'assistant', 'content': \"I'm doing fine and you?\"}]" + "[{'role': 'user', 'content': [{'type': 'text', 'text': 'Hey!'}]},\n", + " {'role': 'assistant', 'content': [{'type': 'text', 'text': 'Hi there!'}]},\n", + " {'role': 'user', 'content': [{'type': 'text', 'text': 'How are you?'}]},\n", + " {'role': 'assistant',\n", + " 'content': [{'type': 'text', 'text': \"I'm doing fine and you?\"}]}]" ] }, "execution_count": null, @@ -878,7 +914,7 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-3cecdfb3-35d9-4531-954b-291f105517ef`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", "- usage: `Usage(completion_tokens=20, prompt_tokens=9, total_tokens=29, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None)`\n", @@ -886,7 +922,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-3cecdfb3-35d9-4531-954b-291f105517ef', created=1758422568, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Hello! How are you doing today? Is there anything I can help you with?', role='assistant', tool_calls=None, function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=20, prompt_tokens=9, total_tokens=29, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Hello! How are you doing today? Is there anything I can help you with?', role='assistant', tool_calls=None, function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=20, prompt_tokens=9, total_tokens=29, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" ] }, "execution_count": null, @@ -994,15 +1030,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-96cab44c-7643-4be3-ab89-13ad06e553ab`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `tool_calls`\n", - "- usage: `Usage(completion_tokens=160, prompt_tokens=475, total_tokens=635, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=160, prompt_tokens=475, total_tokens=635, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-96cab44c-7643-4be3-ab89-13ad06e553ab', created=1758422568, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=\"I'll help you calculate both of those addition problems using the simple_add tool. Let me perform both calculations for you:\", role='assistant', tool_calls=[ChatCompletionMessageToolCall(index=1, function=Function(arguments='{\"a\": 5478954793, \"b\": 547982745}', name='simple_add'), id='toolu_013MZMqJL4fBRGTsMtAGJjMk', type='function'), ChatCompletionMessageToolCall(index=2, function=Function(arguments='{\"a\": 5479749754, \"b\": 9875438979}', name='simple_add'), id='toolu_01HkbM4zwAb38n4rH7SNvi75', type='function')], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=160, prompt_tokens=475, total_tokens=635, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=\"I'll help you calculate both of those addition problems using the simple_add tool. Let me perform both calculations for you:\", role='assistant', tool_calls=[ChatCompletionMessageToolCall(index=1, function=Function(arguments='{\"a\": 5478954793, \"b\": 547982745}', name='simple_add'), id='toolu_013MZMqJL4fBRGTsMtAGJjMk', type='function'), ChatCompletionMessageToolCall(index=2, function=Function(arguments='{\"a\": 5479749754, \"b\": 9875438979}', name='simple_add'), id='toolu_01HkbM4zwAb38n4rH7SNvi75', type='function')], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=160, prompt_tokens=475, total_tokens=635, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "execution_count": null, @@ -1136,7 +1172,7 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-930b0ca8-f58e-4a5d-af60-4a8b4f8d5557`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `tool_calls`\n", "- usage: `Usage(completion_tokens=197, prompt_tokens=475, total_tokens=672, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None)`\n", @@ -1144,7 +1180,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-930b0ca8-f58e-4a5d-af60-4a8b4f8d5557', created=1758422568, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=\"I'll help you calculate both of those sums using the addition tool. Let me perform both calculations for you:\\n\\n1. First, I'll calculate 5478954793 + 547982745\\n2. Then, I'll calculate 5479749754 + 9875438979\", role='assistant', tool_calls=[ChatCompletionMessageToolCall(function=Function(arguments='{\"a\": 5478954793, \"b\": 547982745}', name='simple_add'), id='toolu_018E853fnQvQRskwHNSsPs8w', type='function'), ChatCompletionMessageToolCall(function=Function(arguments='{\"a\": 5479749754, \"b\": 9875438979}', name='simple_add'), id='toolu_01W3NFMfY5mSDdDVtgicRe4Q', type='function')], function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=197, prompt_tokens=475, total_tokens=672, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=\"I'll help you calculate both of those sums using the addition tool. Let me perform both calculations for you:\\n\\n1. First, I'll calculate 5478954793 + 547982745\\n2. Then, I'll calculate 5479749754 + 9875438979\", role='assistant', tool_calls=[ChatCompletionMessageToolCall(function=Function(arguments='{\"a\": 5478954793, \"b\": 547982745}', name='simple_add'), id='toolu_018E853fnQvQRskwHNSsPs8w', type='function'), ChatCompletionMessageToolCall(function=Function(arguments='{\"a\": 5479749754, \"b\": 9875438979}', name='simple_add'), id='toolu_01W3NFMfY5mSDdDVtgicRe4Q', type='function')], function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=197, prompt_tokens=475, total_tokens=672, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" ] }, "execution_count": null, @@ -1230,7 +1266,7 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-2bced32f-1a05-489a-97e2-6dd3c163d008`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", "- usage: `Usage(completion_tokens=433, prompt_tokens=66, total_tokens=499, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=205, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None)`\n", @@ -1238,7 +1274,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-2bced32f-1a05-489a-97e2-6dd3c163d008', created=1758422569, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content=\"I'll find the derivative of f(x) = x鲁 + 2x虏 - 5x + 1 using the power rule.\\n\\nThe power rule states that for any term ax^n, the derivative is nax^(n-1).\\n\\nTaking the derivative of each term:\\n\\n**Term 1:** x鲁\\n- Derivative: 3x^(3-1) = 3x虏\\n\\n**Term 2:** 2x虏 \\n- Derivative: 2 脳 2x^(2-1) = 4x\\n\\n**Term 3:** -5x\\n- Derivative: -5 脳 1x^(1-1) = -5\\n\\n**Term 4:** 1 (constant)\\n- Derivative: 0\\n\\n**Final Answer:**\\nf'(x) = 3x虏 + 4x - 5\", role='assistant', tool_calls=None, function_call=None, provider_specific_fields=None, thinking_blocks=[{'type': 'thinking', 'thinking': \"I need to find the derivative of the function f(x) = x^3 + 2x^2 - 5x + 1.\\n\\nI'll use the power rule for derivatives, which states that if f(x) = x^n, then f'(x) = nx^(n-1).\\n\\nLet me take the derivative of each term:\\n\\n1) For x^3: The derivative is 3x^(3-1) = 3x^2\\n2) For 2x^2: The derivative is 2 路 2x^(2-1) = 4x\\n3) For -5x: The derivative is -5 路 1x^(1-1) = -5x^0 = -5\\n4) For the constant 1: The derivative of any constant is 0\\n\\nSo the derivative is: 3x^2 + 4x - 5 + 0 = 3x^2 + 4x - 5\", 'signature': 'Eo4FCkYIBxgCKkDYpmV8bmbO2hMcNNjoiEju7Bq203xL5XgVRaQou4xDja7JHmRpeAKH01+uDSdMIjY6saSHwVhm9B0THnyqoBFtEgw6ZIwvUa51SCFUym8aDMi+gs0t/d1JU//qmCIwF/fycNXbo1EiddKqAmFQvsAiNcBXQ9mg8WDoXLgnSnl/upY4QNJQxklIwNqWhPloKvUDr2W6ppA3QGQlDnnUCdyDiJD04GCmNHDtdbwLBPKqVyecg5nE9APb7K/VJi2TensSBWJKN7JiZyREOTqYqIe7Ev+dPFJKn6dJb0E7Zbbq2t4FSsk/TflMFk151YRZ5oggl6Oa3wo7Lfhboe0JQbpTXfAK5ZHS0ckFrildgn8TA7Eg2Z+iuMNVn/fZaNgLIRNNTCEb0O0Vh/O/rhz52OTZm7Ro9bjeF3kxF9wYopQTFrZhljrlGgvQPWPuL0LCw6D0zKvU5ZXb9pfGT47cryJ1mwG9HUoi5q3/XE105tXq93VrjRJoWSyyg/hcZ41Vti8Gppv0yP7d0ylgc3lQe/qJPI78Y6Am62g3kgB9HKM7hGpi3Xd2ybL9NKXvMEBBUnV4IDMmjTFwwfTSl6UXrOkqoOTrQrlKxO5S/IkEkY/S6sEOEuEe6aBbiR80fM2LHPzD9SjJ/cvUeS7e5rY1cjtz6OPmpzCeJOATtgmGEUg82NW6Xv+GHONbTfmk7PGBdgTwQnByyFdbdjZbCygw6uix6kXBBKWEa/56qpWDoMms9c06iaJUhxC7HwrXKYs5+PtUMCAMmmdtnNTop5UJb688yZPb52w2M2bcGBeiKuUdYXqCf+d2A0qYreLGJYbf8PfI6LasV68DMqMOms8ukXT59PXWlyQ3GAE='}], reasoning_content=\"I need to find the derivative of the function f(x) = x^3 + 2x^2 - 5x + 1.\\n\\nI'll use the power rule for derivatives, which states that if f(x) = x^n, then f'(x) = nx^(n-1).\\n\\nLet me take the derivative of each term:\\n\\n1) For x^3: The derivative is 3x^(3-1) = 3x^2\\n2) For 2x^2: The derivative is 2 路 2x^(2-1) = 4x\\n3) For -5x: The derivative is -5 路 1x^(1-1) = -5x^0 = -5\\n4) For the constant 1: The derivative of any constant is 0\\n\\nSo the derivative is: 3x^2 + 4x - 5 + 0 = 3x^2 + 4x - 5\"))], usage=Usage(completion_tokens=433, prompt_tokens=66, total_tokens=499, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=205, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content=\"I'll find the derivative of f(x) = x鲁 + 2x虏 - 5x + 1 using the power rule.\\n\\nThe power rule states that for any term ax^n, the derivative is nax^(n-1).\\n\\nTaking the derivative of each term:\\n\\n**Term 1:** x鲁\\n- Derivative: 3x^(3-1) = 3x虏\\n\\n**Term 2:** 2x虏 \\n- Derivative: 2 脳 2x^(2-1) = 4x\\n\\n**Term 3:** -5x\\n- Derivative: -5 脳 1x^(1-1) = -5\\n\\n**Term 4:** 1 (constant)\\n- Derivative: 0\\n\\n**Final Answer:**\\nf'(x) = 3x虏 + 4x - 5\", role='assistant', tool_calls=None, function_call=None, provider_specific_fields=None, thinking_blocks=[{'type': 'thinking', 'thinking': \"I need to find the derivative of the function f(x) = x^3 + 2x^2 - 5x + 1.\\n\\nI'll use the power rule for derivatives, which states that if f(x) = x^n, then f'(x) = nx^(n-1).\\n\\nLet me take the derivative of each term:\\n\\n1) For x^3: The derivative is 3x^(3-1) = 3x^2\\n2) For 2x^2: The derivative is 2 路 2x^(2-1) = 4x\\n3) For -5x: The derivative is -5 路 1x^(1-1) = -5x^0 = -5\\n4) For the constant 1: The derivative of any constant is 0\\n\\nSo the derivative is: 3x^2 + 4x - 5 + 0 = 3x^2 + 4x - 5\", 'signature': 'Eo4FCkYIBxgCKkDYpmV8bmbO2hMcNNjoiEju7Bq203xL5XgVRaQou4xDja7JHmRpeAKH01+uDSdMIjY6saSHwVhm9B0THnyqoBFtEgw6ZIwvUa51SCFUym8aDMi+gs0t/d1JU//qmCIwF/fycNXbo1EiddKqAmFQvsAiNcBXQ9mg8WDoXLgnSnl/upY4QNJQxklIwNqWhPloKvUDr2W6ppA3QGQlDnnUCdyDiJD04GCmNHDtdbwLBPKqVyecg5nE9APb7K/VJi2TensSBWJKN7JiZyREOTqYqIe7Ev+dPFJKn6dJb0E7Zbbq2t4FSsk/TflMFk151YRZ5oggl6Oa3wo7Lfhboe0JQbpTXfAK5ZHS0ckFrildgn8TA7Eg2Z+iuMNVn/fZaNgLIRNNTCEb0O0Vh/O/rhz52OTZm7Ro9bjeF3kxF9wYopQTFrZhljrlGgvQPWPuL0LCw6D0zKvU5ZXb9pfGT47cryJ1mwG9HUoi5q3/XE105tXq93VrjRJoWSyyg/hcZ41Vti8Gppv0yP7d0ylgc3lQe/qJPI78Y6Am62g3kgB9HKM7hGpi3Xd2ybL9NKXvMEBBUnV4IDMmjTFwwfTSl6UXrOkqoOTrQrlKxO5S/IkEkY/S6sEOEuEe6aBbiR80fM2LHPzD9SjJ/cvUeS7e5rY1cjtz6OPmpzCeJOATtgmGEUg82NW6Xv+GHONbTfmk7PGBdgTwQnByyFdbdjZbCygw6uix6kXBBKWEa/56qpWDoMms9c06iaJUhxC7HwrXKYs5+PtUMCAMmmdtnNTop5UJb688yZPb52w2M2bcGBeiKuUdYXqCf+d2A0qYreLGJYbf8PfI6LasV68DMqMOms8ukXT59PXWlyQ3GAE='}], reasoning_content=\"I need to find the derivative of the function f(x) = x^3 + 2x^2 - 5x + 1.\\n\\nI'll use the power rule for derivatives, which states that if f(x) = x^n, then f'(x) = nx^(n-1).\\n\\nLet me take the derivative of each term:\\n\\n1) For x^3: The derivative is 3x^(3-1) = 3x^2\\n2) For 2x^2: The derivative is 2 路 2x^(2-1) = 4x\\n3) For -5x: The derivative is -5 路 1x^(1-1) = -5x^0 = -5\\n4) For the constant 1: The derivative of any constant is 0\\n\\nSo the derivative is: 3x^2 + 4x - 5 + 0 = 3x^2 + 4x - 5\"))], usage=Usage(completion_tokens=433, prompt_tokens=66, total_tokens=499, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=205, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" ] }, "execution_count": null, @@ -1287,15 +1323,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-f2d7ca96-2f1f-4f92-b1c2-3f9307038930`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=603, prompt_tokens=13314, total_tokens=13917, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), server_tool_use=ServerToolUse(web_search_requests=1), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=603, prompt_tokens=13314, total_tokens=13917, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), server_tool_use=ServerToolUse(web_search_requests=1), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-f2d7ca96-2f1f-4f92-b1c2-3f9307038930', created=1758422569, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content=\"Otters are fascinating semiaquatic mammals that belong to the weasel family. The charismatic otter, a member of the weasel family, is found on every continent except Australia and Antarctica. There are 13 species in total, ranging from the small-clawed otter to the giant otter.\\n\\nMost are small, with short ears and noses, elongated bodies, long tails, and soft, dense fur. Otters have the densest fur of any animal鈥攁s many as a million hairs per square inch in places. Webbed feet and powerful tails, which act like rudders, make otters strong swimmers.\\n\\nAll otters are expert hunters that eat fish, crustaceans, and other critters. Sea otters have a unique feeding behavior: A sea otter will float on its back, place a rock on its chest, then smash the mollusk down on it until it breaks open. River otters, however, can hold their breath for up to 8 minutes.\\n\\nRiver otters are especially playful, gamboling on land and splashing into rivers and streams. Otters live up to 16 years; they are by nature playful, and frolic in the water with their pups. When resting, sea otters entangle themselves in kelp so they don't float away.\\n\\nMany otter species face conservation challenges. Otters and their mustelid relatives were once hunted extensively for their fur, many to the point of near extinction. Despite regulations designed to protect them, many species remain at risk from pollution and habitat loss.\", role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': [[{'type': 'web_search_result_location', 'cited_text': 'The charismatic otter, a member of the weasel family, is found on every continent except Australia and Antarctica. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDLIIDjwxPgKn3T1dcBoMOiqvShGJLxd8+SdzIjCz3SlTIqO2HA5gvks2pAQGmz3XWB+xFAaljcWlyygSy/kTY7sqeqMn1qU4tGpBmf4qE4abQbfNHbLywouCbZ9quTv0iwgYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'There are 13 species in total, ranging from the small-clawed otter to the giant otter.', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDCXseI4G8zexyxzXlRoMpFgWRLWJhF6OCzWzIjC4h57A4xvrpWQFrK5X4R5FCgSieqLTHAhYMDpZKSfmktNjvZEhPRsh65kdvMm1/TMqE8nJZb8r81E83mBk45fzBfkGEF4YBA=='}, {'type': 'web_search_result_location', 'cited_text': 'There are 14 known species of otters, ranging in size and habitat preferences, with some species adapted to cold waters requiring a high metabolic rat...', 'url': 'https://en.wikipedia.org/wiki/Otter', 'title': 'Otter - Wikipedia', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDMBGz/TkkP7vJ/5bBBoM6OKET14S7EBuRDq5IjCdnxv7okJjoIxqiaU0kmfBEJ3V8tboSz+XFgFEGPxIyKThi6pIEgjWFQWJpwIvWMEqE24LwoVusqslEH/NExIYNSa+GdQYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'Most are small, with short ears and noses, elongated bodies, long tails, and soft, dense fur. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDNH8Zg5oGTTIuNgWbhoM203UStaxnwT6ihm3IjCJO09/UFQsgEsQDC6HMT95Uvq5eX9qnL7+rTsmYXFAUUCDUdofHzjcOxwNHLCwXjsqEyGDArRktHJMZWjqQ75J2rJzQIUYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'Otters have the densest fur of any animal鈥攁s many as a million hairs per square inch in places. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDOM+ZAdwxG6vExmODhoMpZpQzqs8haGSfQzzIjBuCmrn97nFh1fkEDH+x5wSdfuyWZdCH4C0IOMr4IRxpMCjxixd9bdsqvkWH5BlI90qE84aNPZNvlF9U3B2yi0OFSTIjUsYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'Webbed feet and powerful tails, which act like rudders, make otters strong swimmers. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDB4SDVlqNhefbSSuzxoMeG4s1rBdtpIgK0DSIjBX3WipgCcchJ4jFkLFj4/COw6rDv4fyRw4Xe4GmR3Dpo4TCUrgwHoJmO6l8MK4kTMqFOEpHWwGbHkFVUd+Aq1NOx2lpNPRGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'All otters are expert hunters that eat fish, crustaceans, and other critters. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDBEyDl3t5gAz0iW2JxoMLzj6yl7IqCr/rkQFIjDc7DkfXM7M8ELyQrl7PgcEJwHGQ2IbW6kDSpbVdQR9q6pqQiFAonIGapSO6bOs8lcqFNxFIb6J9DOBWrepkBD9oLphplfWGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'A sea otter will float on its back, place a rock on its chest, then smash the mollusk down on it until it breaks open. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDA0ilE2w5h7YdRjMzhoMqwIS1XuE51cgr+7wIjC8Jm4aMVIY12LLXkgVX2aDuWfaz4V2YH9VxtHDFglIlgA6zNp5gE+1+M4bj2YkdLoqFKCvef+BMeVSAFwlkJtEYJYVwGvYGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'River otters, however, can hold their breath for up to 8 minutes. ', 'url': 'https://www.doi.gov/blog/12-facts-about-otters-sea-otter-awareness-week', 'title': '12 Facts About Otters for Sea Otter Awareness Week | U.S. Department of the Interior', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDBRRB8XLgZXQcvTOzxoM7ICPdtJHrGPgTjBgIjAwJzEqHlU34vJgq2xCl91sP8PUJojcyUmr3RjFmjSOCl6DSGhxaIIFMZuf2LIydG4qFOSehmf1sOfabXVUU/3zEtuYUF15GAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'River otters are especially playful, gamboling on land and splashing into rivers and streams. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDB57wjzqdgmYw53MIxoMbnctVN4aNFUYI2QyIjCeO6ekN1PB/st0ohcHxwVnl7Hm2uKHdJsB6qhKHD9zcFdBHWi4bXmkITh1prJiP+EqFEDV9W/kth6i6gPvo5fFJ91A8ZgCGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'Otters live up to 16 years; they are by nature playful, and frolic in the water with their pups. ', 'url': 'https://en.wikipedia.org/wiki/Otter', 'title': 'Otter - Wikipedia', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDKANsJtkm8sPve7PxRoMBV2hF6Bv9+BRCaLdIjCbmBPNZLWyg/fl9fIqE2yzUgazsFZOzLxn1SsM+vzPaUIFNuDMDQQ2kyfRUJt3thcqFI5qd+bcbUuz7G8sVhT8+5Npf2oJGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'When it鈥檚 time to nap, sea otters entangle themselves in kelp so they don鈥檛 float away. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDLGvrNLsLI08xlvgTBoM9IV7m9dO6UW4WiPQIjA+J2H71NbOFXTC9c/BSXoc/k5LWai1PWOl/RTN6DvcX7+aoNa5X8vUj0aA4b9m+VkqFPEjP3FFBjUYjR3a8FST57xIkOM5GAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'Otters and their mustelid relatives were once hunted extensively for their fur, many to the point of near extinction. Despite regulations designed to ...', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpMBCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDGpQatyaoWKjXpMGZxoM4lzcl/OByeZqtkXVIjB1sXm55ThwnOma8DGFbuaHxzNH5TuEDVReHHdd+RSoQ4qVRlu/xPhPpK5EX5Z7iuQqF1a45PWr6Is2p49kQjUlwAmSPJJTSYlmGAQ='}]], 'thinking_blocks': None}))], usage=Usage(completion_tokens=603, prompt_tokens=13314, total_tokens=13917, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), server_tool_use=ServerToolUse(web_search_requests=1), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content=\"Otters are fascinating semiaquatic mammals that belong to the weasel family. The charismatic otter, a member of the weasel family, is found on every continent except Australia and Antarctica. There are 13 species in total, ranging from the small-clawed otter to the giant otter.\\n\\nMost are small, with short ears and noses, elongated bodies, long tails, and soft, dense fur. Otters have the densest fur of any animal鈥攁s many as a million hairs per square inch in places. Webbed feet and powerful tails, which act like rudders, make otters strong swimmers.\\n\\nAll otters are expert hunters that eat fish, crustaceans, and other critters. Sea otters have a unique feeding behavior: A sea otter will float on its back, place a rock on its chest, then smash the mollusk down on it until it breaks open. River otters, however, can hold their breath for up to 8 minutes.\\n\\nRiver otters are especially playful, gamboling on land and splashing into rivers and streams. Otters live up to 16 years; they are by nature playful, and frolic in the water with their pups. When resting, sea otters entangle themselves in kelp so they don't float away.\\n\\nMany otter species face conservation challenges. Otters and their mustelid relatives were once hunted extensively for their fur, many to the point of near extinction. Despite regulations designed to protect them, many species remain at risk from pollution and habitat loss.\", role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': [[{'type': 'web_search_result_location', 'cited_text': 'The charismatic otter, a member of the weasel family, is found on every continent except Australia and Antarctica. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDLIIDjwxPgKn3T1dcBoMOiqvShGJLxd8+SdzIjCz3SlTIqO2HA5gvks2pAQGmz3XWB+xFAaljcWlyygSy/kTY7sqeqMn1qU4tGpBmf4qE4abQbfNHbLywouCbZ9quTv0iwgYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'There are 13 species in total, ranging from the small-clawed otter to the giant otter.', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDCXseI4G8zexyxzXlRoMpFgWRLWJhF6OCzWzIjC4h57A4xvrpWQFrK5X4R5FCgSieqLTHAhYMDpZKSfmktNjvZEhPRsh65kdvMm1/TMqE8nJZb8r81E83mBk45fzBfkGEF4YBA=='}, {'type': 'web_search_result_location', 'cited_text': 'There are 14 known species of otters, ranging in size and habitat preferences, with some species adapted to cold waters requiring a high metabolic rat...', 'url': 'https://en.wikipedia.org/wiki/Otter', 'title': 'Otter - Wikipedia', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDMBGz/TkkP7vJ/5bBBoM6OKET14S7EBuRDq5IjCdnxv7okJjoIxqiaU0kmfBEJ3V8tboSz+XFgFEGPxIyKThi6pIEgjWFQWJpwIvWMEqE24LwoVusqslEH/NExIYNSa+GdQYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'Most are small, with short ears and noses, elongated bodies, long tails, and soft, dense fur. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDNH8Zg5oGTTIuNgWbhoM203UStaxnwT6ihm3IjCJO09/UFQsgEsQDC6HMT95Uvq5eX9qnL7+rTsmYXFAUUCDUdofHzjcOxwNHLCwXjsqEyGDArRktHJMZWjqQ75J2rJzQIUYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'Otters have the densest fur of any animal鈥攁s many as a million hairs per square inch in places. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDOM+ZAdwxG6vExmODhoMpZpQzqs8haGSfQzzIjBuCmrn97nFh1fkEDH+x5wSdfuyWZdCH4C0IOMr4IRxpMCjxixd9bdsqvkWH5BlI90qE84aNPZNvlF9U3B2yi0OFSTIjUsYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'Webbed feet and powerful tails, which act like rudders, make otters strong swimmers. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDB4SDVlqNhefbSSuzxoMeG4s1rBdtpIgK0DSIjBX3WipgCcchJ4jFkLFj4/COw6rDv4fyRw4Xe4GmR3Dpo4TCUrgwHoJmO6l8MK4kTMqFOEpHWwGbHkFVUd+Aq1NOx2lpNPRGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'All otters are expert hunters that eat fish, crustaceans, and other critters. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDBEyDl3t5gAz0iW2JxoMLzj6yl7IqCr/rkQFIjDc7DkfXM7M8ELyQrl7PgcEJwHGQ2IbW6kDSpbVdQR9q6pqQiFAonIGapSO6bOs8lcqFNxFIb6J9DOBWrepkBD9oLphplfWGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'A sea otter will float on its back, place a rock on its chest, then smash the mollusk down on it until it breaks open. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDA0ilE2w5h7YdRjMzhoMqwIS1XuE51cgr+7wIjC8Jm4aMVIY12LLXkgVX2aDuWfaz4V2YH9VxtHDFglIlgA6zNp5gE+1+M4bj2YkdLoqFKCvef+BMeVSAFwlkJtEYJYVwGvYGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'River otters, however, can hold their breath for up to 8 minutes. ', 'url': 'https://www.doi.gov/blog/12-facts-about-otters-sea-otter-awareness-week', 'title': '12 Facts About Otters for Sea Otter Awareness Week | U.S. Department of the Interior', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDBRRB8XLgZXQcvTOzxoM7ICPdtJHrGPgTjBgIjAwJzEqHlU34vJgq2xCl91sP8PUJojcyUmr3RjFmjSOCl6DSGhxaIIFMZuf2LIydG4qFOSehmf1sOfabXVUU/3zEtuYUF15GAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'River otters are especially playful, gamboling on land and splashing into rivers and streams. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDB57wjzqdgmYw53MIxoMbnctVN4aNFUYI2QyIjCeO6ekN1PB/st0ohcHxwVnl7Hm2uKHdJsB6qhKHD9zcFdBHWi4bXmkITh1prJiP+EqFEDV9W/kth6i6gPvo5fFJ91A8ZgCGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'Otters live up to 16 years; they are by nature playful, and frolic in the water with their pups. ', 'url': 'https://en.wikipedia.org/wiki/Otter', 'title': 'Otter - Wikipedia', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDKANsJtkm8sPve7PxRoMBV2hF6Bv9+BRCaLdIjCbmBPNZLWyg/fl9fIqE2yzUgazsFZOzLxn1SsM+vzPaUIFNuDMDQQ2kyfRUJt3thcqFI5qd+bcbUuz7G8sVhT8+5Npf2oJGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'When it鈥檚 time to nap, sea otters entangle themselves in kelp so they don鈥檛 float away. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDLGvrNLsLI08xlvgTBoM9IV7m9dO6UW4WiPQIjA+J2H71NbOFXTC9c/BSXoc/k5LWai1PWOl/RTN6DvcX7+aoNa5X8vUj0aA4b9m+VkqFPEjP3FFBjUYjR3a8FST57xIkOM5GAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'Otters and their mustelid relatives were once hunted extensively for their fur, many to the point of near extinction. Despite regulations designed to ...', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpMBCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDGpQatyaoWKjXpMGZxoM4lzcl/OByeZqtkXVIjB1sXm55ThwnOma8DGFbuaHxzNH5TuEDVReHHdd+RSoQ4qVRlu/xPhPpK5EX5Z7iuQqF1a45PWr6Is2p49kQjUlwAmSPJJTSYlmGAQ='}]], 'thinking_blocks': None}))], usage=Usage(completion_tokens=603, prompt_tokens=13314, total_tokens=13917, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), server_tool_use=ServerToolUse(web_search_requests=1), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "execution_count": null, @@ -1379,15 +1415,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-4c21d727-cd54-42a5-8eae-97d949db5914`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=603, prompt_tokens=13314, total_tokens=13917, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), server_tool_use=ServerToolUse(web_search_requests=1), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=603, prompt_tokens=13314, total_tokens=13917, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), server_tool_use=ServerToolUse(web_search_requests=1), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-4c21d727-cd54-42a5-8eae-97d949db5914', created=1758422569, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content=\"Otters are fascinating semiaquatic mammals that belong to the weasel family. The charismatic otter, a member of the weasel family, is found on every continent except Australia and Antarctica. There are 13 species in total, ranging from the small-clawed otter to the giant otter.\\n\\nMost are small, with short ears and noses, elongated bodies, long tails, and soft, dense fur. Otters have the densest fur of any animal鈥攁s many as a million hairs per square inch in places. Webbed feet and powerful tails, which act like rudders, make otters strong swimmers.\\n\\nAll otters are expert hunters that eat fish, crustaceans, and other critters. Sea otters have a unique feeding behavior: A sea otter will float on its back, place a rock on its chest, then smash the mollusk down on it until it breaks open. River otters, however, can hold their breath for up to 8 minutes.\\n\\nRiver otters are especially playful, gamboling on land and splashing into rivers and streams. Otters live up to 16 years; they are by nature playful, and frolic in the water with their pups. When resting, sea otters entangle themselves in kelp so they don't float away.\\n\\nMany otter species face conservation challenges. Otters and their mustelid relatives were once hunted extensively for their fur, many to the point of near extinction. Despite regulations designed to protect them, many species remain at risk from pollution and habitat loss.\", role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': [[{'type': 'web_search_result_location', 'cited_text': 'The charismatic otter, a member of the weasel family, is found on every continent except Australia and Antarctica. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDLIIDjwxPgKn3T1dcBoMOiqvShGJLxd8+SdzIjCz3SlTIqO2HA5gvks2pAQGmz3XWB+xFAaljcWlyygSy/kTY7sqeqMn1qU4tGpBmf4qE4abQbfNHbLywouCbZ9quTv0iwgYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'There are 13 species in total, ranging from the small-clawed otter to the giant otter.', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDCXseI4G8zexyxzXlRoMpFgWRLWJhF6OCzWzIjC4h57A4xvrpWQFrK5X4R5FCgSieqLTHAhYMDpZKSfmktNjvZEhPRsh65kdvMm1/TMqE8nJZb8r81E83mBk45fzBfkGEF4YBA=='}, {'type': 'web_search_result_location', 'cited_text': 'There are 14 known species of otters, ranging in size and habitat preferences, with some species adapted to cold waters requiring a high metabolic rat...', 'url': 'https://en.wikipedia.org/wiki/Otter', 'title': 'Otter - Wikipedia', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDMBGz/TkkP7vJ/5bBBoM6OKET14S7EBuRDq5IjCdnxv7okJjoIxqiaU0kmfBEJ3V8tboSz+XFgFEGPxIyKThi6pIEgjWFQWJpwIvWMEqE24LwoVusqslEH/NExIYNSa+GdQYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'Most are small, with short ears and noses, elongated bodies, long tails, and soft, dense fur. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDNH8Zg5oGTTIuNgWbhoM203UStaxnwT6ihm3IjCJO09/UFQsgEsQDC6HMT95Uvq5eX9qnL7+rTsmYXFAUUCDUdofHzjcOxwNHLCwXjsqEyGDArRktHJMZWjqQ75J2rJzQIUYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'Otters have the densest fur of any animal鈥攁s many as a million hairs per square inch in places. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDOM+ZAdwxG6vExmODhoMpZpQzqs8haGSfQzzIjBuCmrn97nFh1fkEDH+x5wSdfuyWZdCH4C0IOMr4IRxpMCjxixd9bdsqvkWH5BlI90qE84aNPZNvlF9U3B2yi0OFSTIjUsYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'Webbed feet and powerful tails, which act like rudders, make otters strong swimmers. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDB4SDVlqNhefbSSuzxoMeG4s1rBdtpIgK0DSIjBX3WipgCcchJ4jFkLFj4/COw6rDv4fyRw4Xe4GmR3Dpo4TCUrgwHoJmO6l8MK4kTMqFOEpHWwGbHkFVUd+Aq1NOx2lpNPRGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'All otters are expert hunters that eat fish, crustaceans, and other critters. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDBEyDl3t5gAz0iW2JxoMLzj6yl7IqCr/rkQFIjDc7DkfXM7M8ELyQrl7PgcEJwHGQ2IbW6kDSpbVdQR9q6pqQiFAonIGapSO6bOs8lcqFNxFIb6J9DOBWrepkBD9oLphplfWGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'A sea otter will float on its back, place a rock on its chest, then smash the mollusk down on it until it breaks open. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDA0ilE2w5h7YdRjMzhoMqwIS1XuE51cgr+7wIjC8Jm4aMVIY12LLXkgVX2aDuWfaz4V2YH9VxtHDFglIlgA6zNp5gE+1+M4bj2YkdLoqFKCvef+BMeVSAFwlkJtEYJYVwGvYGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'River otters, however, can hold their breath for up to 8 minutes. ', 'url': 'https://www.doi.gov/blog/12-facts-about-otters-sea-otter-awareness-week', 'title': '12 Facts About Otters for Sea Otter Awareness Week | U.S. Department of the Interior', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDBRRB8XLgZXQcvTOzxoM7ICPdtJHrGPgTjBgIjAwJzEqHlU34vJgq2xCl91sP8PUJojcyUmr3RjFmjSOCl6DSGhxaIIFMZuf2LIydG4qFOSehmf1sOfabXVUU/3zEtuYUF15GAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'River otters are especially playful, gamboling on land and splashing into rivers and streams. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDB57wjzqdgmYw53MIxoMbnctVN4aNFUYI2QyIjCeO6ekN1PB/st0ohcHxwVnl7Hm2uKHdJsB6qhKHD9zcFdBHWi4bXmkITh1prJiP+EqFEDV9W/kth6i6gPvo5fFJ91A8ZgCGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'Otters live up to 16 years; they are by nature playful, and frolic in the water with their pups. ', 'url': 'https://en.wikipedia.org/wiki/Otter', 'title': 'Otter - Wikipedia', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDKANsJtkm8sPve7PxRoMBV2hF6Bv9+BRCaLdIjCbmBPNZLWyg/fl9fIqE2yzUgazsFZOzLxn1SsM+vzPaUIFNuDMDQQ2kyfRUJt3thcqFI5qd+bcbUuz7G8sVhT8+5Npf2oJGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'When it鈥檚 time to nap, sea otters entangle themselves in kelp so they don鈥檛 float away. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDLGvrNLsLI08xlvgTBoM9IV7m9dO6UW4WiPQIjA+J2H71NbOFXTC9c/BSXoc/k5LWai1PWOl/RTN6DvcX7+aoNa5X8vUj0aA4b9m+VkqFPEjP3FFBjUYjR3a8FST57xIkOM5GAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'Otters and their mustelid relatives were once hunted extensively for their fur, many to the point of near extinction. Despite regulations designed to ...', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpMBCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDGpQatyaoWKjXpMGZxoM4lzcl/OByeZqtkXVIjB1sXm55ThwnOma8DGFbuaHxzNH5TuEDVReHHdd+RSoQ4qVRlu/xPhPpK5EX5Z7iuQqF1a45PWr6Is2p49kQjUlwAmSPJJTSYlmGAQ='}]], 'thinking_blocks': None}))], usage=Usage(completion_tokens=603, prompt_tokens=13314, total_tokens=13917, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), server_tool_use=ServerToolUse(web_search_requests=1), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content=\"Otters are fascinating semiaquatic mammals that belong to the weasel family. The charismatic otter, a member of the weasel family, is found on every continent except Australia and Antarctica. There are 13 species in total, ranging from the small-clawed otter to the giant otter.\\n\\nMost are small, with short ears and noses, elongated bodies, long tails, and soft, dense fur. Otters have the densest fur of any animal鈥攁s many as a million hairs per square inch in places. Webbed feet and powerful tails, which act like rudders, make otters strong swimmers.\\n\\nAll otters are expert hunters that eat fish, crustaceans, and other critters. Sea otters have a unique feeding behavior: A sea otter will float on its back, place a rock on its chest, then smash the mollusk down on it until it breaks open. River otters, however, can hold their breath for up to 8 minutes.\\n\\nRiver otters are especially playful, gamboling on land and splashing into rivers and streams. Otters live up to 16 years; they are by nature playful, and frolic in the water with their pups. When resting, sea otters entangle themselves in kelp so they don't float away.\\n\\nMany otter species face conservation challenges. Otters and their mustelid relatives were once hunted extensively for their fur, many to the point of near extinction. Despite regulations designed to protect them, many species remain at risk from pollution and habitat loss.\", role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': [[{'type': 'web_search_result_location', 'cited_text': 'The charismatic otter, a member of the weasel family, is found on every continent except Australia and Antarctica. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDLIIDjwxPgKn3T1dcBoMOiqvShGJLxd8+SdzIjCz3SlTIqO2HA5gvks2pAQGmz3XWB+xFAaljcWlyygSy/kTY7sqeqMn1qU4tGpBmf4qE4abQbfNHbLywouCbZ9quTv0iwgYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'There are 13 species in total, ranging from the small-clawed otter to the giant otter.', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDCXseI4G8zexyxzXlRoMpFgWRLWJhF6OCzWzIjC4h57A4xvrpWQFrK5X4R5FCgSieqLTHAhYMDpZKSfmktNjvZEhPRsh65kdvMm1/TMqE8nJZb8r81E83mBk45fzBfkGEF4YBA=='}, {'type': 'web_search_result_location', 'cited_text': 'There are 14 known species of otters, ranging in size and habitat preferences, with some species adapted to cold waters requiring a high metabolic rat...', 'url': 'https://en.wikipedia.org/wiki/Otter', 'title': 'Otter - Wikipedia', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDMBGz/TkkP7vJ/5bBBoM6OKET14S7EBuRDq5IjCdnxv7okJjoIxqiaU0kmfBEJ3V8tboSz+XFgFEGPxIyKThi6pIEgjWFQWJpwIvWMEqE24LwoVusqslEH/NExIYNSa+GdQYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'Most are small, with short ears and noses, elongated bodies, long tails, and soft, dense fur. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDNH8Zg5oGTTIuNgWbhoM203UStaxnwT6ihm3IjCJO09/UFQsgEsQDC6HMT95Uvq5eX9qnL7+rTsmYXFAUUCDUdofHzjcOxwNHLCwXjsqEyGDArRktHJMZWjqQ75J2rJzQIUYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'Otters have the densest fur of any animal鈥攁s many as a million hairs per square inch in places. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'Eo8BCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDOM+ZAdwxG6vExmODhoMpZpQzqs8haGSfQzzIjBuCmrn97nFh1fkEDH+x5wSdfuyWZdCH4C0IOMr4IRxpMCjxixd9bdsqvkWH5BlI90qE84aNPZNvlF9U3B2yi0OFSTIjUsYBA=='}], [{'type': 'web_search_result_location', 'cited_text': 'Webbed feet and powerful tails, which act like rudders, make otters strong swimmers. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDB4SDVlqNhefbSSuzxoMeG4s1rBdtpIgK0DSIjBX3WipgCcchJ4jFkLFj4/COw6rDv4fyRw4Xe4GmR3Dpo4TCUrgwHoJmO6l8MK4kTMqFOEpHWwGbHkFVUd+Aq1NOx2lpNPRGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'All otters are expert hunters that eat fish, crustaceans, and other critters. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDBEyDl3t5gAz0iW2JxoMLzj6yl7IqCr/rkQFIjDc7DkfXM7M8ELyQrl7PgcEJwHGQ2IbW6kDSpbVdQR9q6pqQiFAonIGapSO6bOs8lcqFNxFIb6J9DOBWrepkBD9oLphplfWGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'A sea otter will float on its back, place a rock on its chest, then smash the mollusk down on it until it breaks open. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDA0ilE2w5h7YdRjMzhoMqwIS1XuE51cgr+7wIjC8Jm4aMVIY12LLXkgVX2aDuWfaz4V2YH9VxtHDFglIlgA6zNp5gE+1+M4bj2YkdLoqFKCvef+BMeVSAFwlkJtEYJYVwGvYGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'River otters, however, can hold their breath for up to 8 minutes. ', 'url': 'https://www.doi.gov/blog/12-facts-about-otters-sea-otter-awareness-week', 'title': '12 Facts About Otters for Sea Otter Awareness Week | U.S. Department of the Interior', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDBRRB8XLgZXQcvTOzxoM7ICPdtJHrGPgTjBgIjAwJzEqHlU34vJgq2xCl91sP8PUJojcyUmr3RjFmjSOCl6DSGhxaIIFMZuf2LIydG4qFOSehmf1sOfabXVUU/3zEtuYUF15GAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'River otters are especially playful, gamboling on land and splashing into rivers and streams. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDB57wjzqdgmYw53MIxoMbnctVN4aNFUYI2QyIjCeO6ekN1PB/st0ohcHxwVnl7Hm2uKHdJsB6qhKHD9zcFdBHWi4bXmkITh1prJiP+EqFEDV9W/kth6i6gPvo5fFJ91A8ZgCGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'Otters live up to 16 years; they are by nature playful, and frolic in the water with their pups. ', 'url': 'https://en.wikipedia.org/wiki/Otter', 'title': 'Otter - Wikipedia', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDKANsJtkm8sPve7PxRoMBV2hF6Bv9+BRCaLdIjCbmBPNZLWyg/fl9fIqE2yzUgazsFZOzLxn1SsM+vzPaUIFNuDMDQQ2kyfRUJt3thcqFI5qd+bcbUuz7G8sVhT8+5Npf2oJGAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'When it鈥檚 time to nap, sea otters entangle themselves in kelp so they don鈥檛 float away. ', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpABCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDLGvrNLsLI08xlvgTBoM9IV7m9dO6UW4WiPQIjA+J2H71NbOFXTC9c/BSXoc/k5LWai1PWOl/RTN6DvcX7+aoNa5X8vUj0aA4b9m+VkqFPEjP3FFBjUYjR3a8FST57xIkOM5GAQ='}], [{'type': 'web_search_result_location', 'cited_text': 'Otters and their mustelid relatives were once hunted extensively for their fur, many to the point of near extinction. Despite regulations designed to ...', 'url': 'https://www.nationalgeographic.com/animals/mammals/facts/otters-1', 'title': 'Otters, facts and information | National Geographic', 'encrypted_index': 'EpMBCioIBxgCIiQ4ODk4YTFkYy0yMTNkLTRhNmYtOTljYi03ZTBlNTUzZDc0NWISDGpQatyaoWKjXpMGZxoM4lzcl/OByeZqtkXVIjB1sXm55ThwnOma8DGFbuaHxzNH5TuEDVReHHdd+RSoQ4qVRlu/xPhPpK5EX5Z7iuQqF1a45PWr6Is2p49kQjUlwAmSPJJTSYlmGAQ='}]], 'thinking_blocks': None}))], usage=Usage(completion_tokens=603, prompt_tokens=13314, total_tokens=13917, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), server_tool_use=ServerToolUse(web_search_requests=1), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "execution_count": null, @@ -1486,7 +1522,7 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-0f44751e-c6e1-411e-8421-79fb29f643b8`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", "- usage: `Usage(completion_tokens=576, prompt_tokens=13314, total_tokens=13890, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None)`\n", @@ -1494,7 +1530,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-0f44751e-c6e1-411e-8421-79fb29f643b8', created=1758422569, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Otters are [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") members of the weasel family, found on every continent except Australia and Antarctica. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") There are 13-14 species in total, ranging from [*](https://greatergood.org/blog/9-facts-about-the-small-clawed-otter \"9 Facts About Small-Clawed Otters And how you can save them\") the small-clawed otter (the smallest species) to [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") the giant otter and sea otter (the largest).\\n\\n[*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") Most are small, with short ears and noses, elongated bodies, long tails, and soft, dense fur. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") Otters have the densest fur of any animal鈥攁s many as a million hairs per square inch, which keeps them warm in water. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") [*](https://www.pbs.org/wnet/nature/blog/otter-fact-sheet/ \"Otter Fact Sheet | Blog | Nature | PBS\") They have webbed feet and powerful tails that act like rudders, making them strong swimmers.\\n\\n[*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") [*](https://www.pbs.org/wnet/nature/blog/otter-fact-sheet/ \"Otter Fact Sheet | Blog | Nature | PBS\") All otters are expert hunters that eat fish, crustaceans, and other critters. Sea otters are famous for [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") floating on their backs and using rocks to smash open shellfish. [*](https://www.doi.gov/blog/12-facts-about-otters-sea-otter-awareness-week \"12 Facts About Otters for Sea Otter Awareness Week | U.S. Department of the Interior\") Sea otters can stay submerged for more than 5 minutes, while river otters can hold their breath for up to 8 minutes.\\n\\n[*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") They are playful animals, engaging in activities like sliding and splashing. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") Sea otters even entangle themselves in kelp while sleeping and sometimes hold hands with other otters to stay together.\\n\\nMany otter species face conservation challenges due to [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") historical hunting for their fur and current threats from pollution and habitat loss.', role='assistant', tool_calls=[], function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=576, prompt_tokens=13314, total_tokens=13890, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Otters are [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") members of the weasel family, found on every continent except Australia and Antarctica. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") There are 13-14 species in total, ranging from [*](https://greatergood.org/blog/9-facts-about-the-small-clawed-otter \"9 Facts About Small-Clawed Otters And how you can save them\") the small-clawed otter (the smallest species) to [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") the giant otter and sea otter (the largest).\\n\\n[*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") Most are small, with short ears and noses, elongated bodies, long tails, and soft, dense fur. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") Otters have the densest fur of any animal鈥攁s many as a million hairs per square inch, which keeps them warm in water. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") [*](https://www.pbs.org/wnet/nature/blog/otter-fact-sheet/ \"Otter Fact Sheet | Blog | Nature | PBS\") They have webbed feet and powerful tails that act like rudders, making them strong swimmers.\\n\\n[*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") [*](https://www.pbs.org/wnet/nature/blog/otter-fact-sheet/ \"Otter Fact Sheet | Blog | Nature | PBS\") All otters are expert hunters that eat fish, crustaceans, and other critters. Sea otters are famous for [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") floating on their backs and using rocks to smash open shellfish. [*](https://www.doi.gov/blog/12-facts-about-otters-sea-otter-awareness-week \"12 Facts About Otters for Sea Otter Awareness Week | U.S. Department of the Interior\") Sea otters can stay submerged for more than 5 minutes, while river otters can hold their breath for up to 8 minutes.\\n\\n[*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") They are playful animals, engaging in activities like sliding and splashing. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") Sea otters even entangle themselves in kelp while sleeping and sometimes hold hands with other otters to stay together.\\n\\nMany otter species face conservation challenges due to [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") historical hunting for their fur and current threats from pollution and habitat loss.', role='assistant', tool_calls=[], function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=576, prompt_tokens=13314, total_tokens=13890, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" ] }, "execution_count": null, @@ -1649,15 +1685,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-c189c2d5-c887-4e7c-be25-911a5651296a`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=19, prompt_tokens=14, total_tokens=33, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=19, prompt_tokens=14, total_tokens=33, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-c189c2d5-c887-4e7c-be25-911a5651296a', created=1758422569, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Hi Rens! Nice to meet you. How are you doing today?', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=19, prompt_tokens=14, total_tokens=33, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Hi Rens! Nice to meet you. How are you doing today?', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=19, prompt_tokens=14, total_tokens=33, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "execution_count": null, @@ -1684,15 +1720,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-ae3ecc4d-0627-4502-a246-6e24bc9073f5`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=22, prompt_tokens=41, total_tokens=63, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=22, prompt_tokens=41, total_tokens=63, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-ae3ecc4d-0627-4502-a246-6e24bc9073f5', created=1758422569, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Your name is Rens! You introduced yourself to me at the start of our conversation.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=22, prompt_tokens=41, total_tokens=63, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Your name is Rens! You introduced yourself to me at the start of our conversation.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=22, prompt_tokens=41, total_tokens=63, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "execution_count": null, @@ -1741,15 +1777,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-4ca6c331-c049-45cf-95b2-c5398bb0258f`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=6, prompt_tokens=75, total_tokens=81, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=6, prompt_tokens=75, total_tokens=81, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-4ca6c331-c049-45cf-95b2-c5398bb0258f', created=1758422569, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Your name is R E N S.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=6, prompt_tokens=75, total_tokens=81, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Your name is R E N S.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=6, prompt_tokens=75, total_tokens=81, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "execution_count": null, @@ -1826,7 +1862,7 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-94750820-86b2-4b7b-a7a8-8862d7d36695`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", "- usage: `Usage(completion_tokens=13, prompt_tokens=11, total_tokens=24, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None)`\n", @@ -1834,7 +1870,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-94750820-86b2-4b7b-a7a8-8862d7d36695', created=1758422569, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='1\\n2\\n3\\n4\\n5', role='assistant', tool_calls=None, function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=13, prompt_tokens=11, total_tokens=24, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='1\\n2\\n3\\n4\\n5', role='assistant', tool_calls=None, function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=13, prompt_tokens=11, total_tokens=24, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" ] }, "metadata": {}, @@ -1879,7 +1915,7 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-4c71e25f-e8e4-44d2-929f-d513aee9ecf8`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", "- usage: `Usage(completion_tokens=13, prompt_tokens=40, total_tokens=53, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None)`\n", @@ -1887,7 +1923,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-4c71e25f-e8e4-44d2-929f-d513aee9ecf8', created=1758422570, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Okay! 6, 7, 8, 9, 10.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=13, prompt_tokens=40, total_tokens=53, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Okay! 6, 7, 8, 9, 10.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=13, prompt_tokens=40, total_tokens=53, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" ] }, "metadata": {}, @@ -1945,9 +1981,10 @@ "text/markdown": [ "5 + 3 = 8.\n", "\n", + "\n", "
\n", "\n", - "- id: `6dLLaKyfNqiwvdIP2qGGeA`\n", + "- id: `chatcmpl-xxx`\n", "- model: `gemini-2.5-flash`\n", "- finish_reason: `stop`\n", "- usage: `Usage(completion_tokens=8, prompt_tokens=108, total_tokens=116, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=None, text_tokens=108, image_tokens=None))`\n", @@ -1955,7 +1992,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='6dLLaKyfNqiwvdIP2qGGeA', created=1758422571, model='gemini-2.5-flash', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='5 + 3 = 8.', role='assistant', tool_calls=None, function_call=None, images=[], thinking_blocks=[], provider_specific_fields=None))], usage=Usage(completion_tokens=8, prompt_tokens=108, total_tokens=116, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=None, text_tokens=108, image_tokens=None)), vertex_ai_grounding_metadata=[], vertex_ai_url_context_metadata=[], vertex_ai_safety_results=[], vertex_ai_citation_metadata=[])" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='gemini-2.5-flash', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='5 + 3 = 8.\\n', role='assistant', tool_calls=None, function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=8, prompt_tokens=108, total_tokens=116, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=None, text_tokens=108, image_tokens=None)), vertex_ai_grounding_metadata=[], vertex_ai_url_context_metadata=[], vertex_ai_safety_results=[], vertex_ai_citation_metadata=[])" ] }, "metadata": {}, @@ -1984,15 +2021,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-d9a9a0bc-865d-4a6c-9af3-beee6b6283dc`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=12, prompt_tokens=527, total_tokens=539, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=12, prompt_tokens=527, total_tokens=539, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-d9a9a0bc-865d-4a6c-9af3-beee6b6283dc', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='5 + 3 = 8', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=12, prompt_tokens=527, total_tokens=539, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='5 + 3 = 8', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=12, prompt_tokens=527, total_tokens=539, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "metadata": {}, @@ -2021,7 +2058,7 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-CGk1F5X8YRwN09Bks4bJOSGnmYxka`\n", + "- id: `chatcmpl-xxx`\n", "- model: `gpt-4.1-2025-04-14`\n", "- finish_reason: `stop`\n", "- usage: `Usage(completion_tokens=9, prompt_tokens=101, total_tokens=110, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None))`\n", @@ -2029,7 +2066,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-CGk1F5X8YRwN09Bks4bJOSGnmYxka', created=1758106181, model='gpt-4.1-2025-04-14', object='chat.completion', system_fingerprint='fp_3502f4eb73', choices=[Choices(finish_reason='stop', index=0, message=Message(content='5 + 3 equals 8.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={})], usage=Usage(completion_tokens=9, prompt_tokens=101, total_tokens=110, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)), service_tier='default')" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='gpt-4.1-2025-04-14', object='chat.completion', system_fingerprint='fp_daf5fcc80a', choices=[Choices(finish_reason='stop', index=0, message=Message(content='5 + 3 equals 8.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={})], usage=Usage(completion_tokens=9, prompt_tokens=101, total_tokens=110, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)), service_tier='default')" ] }, "metadata": {}, @@ -2075,15 +2112,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-82b9f47a-66cb-4a91-87be-057db66ca93c`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `tool_calls`\n", - "- usage: `Usage(completion_tokens=165, prompt_tokens=455, total_tokens=620, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=81, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=165, prompt_tokens=455, total_tokens=620, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=81, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-82b9f47a-66cb-4a91-87be-057db66ca93c', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=None, role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 3}', 'name': 'simple_add'}, 'id': 'toolu_01QBLkGLtd85Yj8eEiFVBu4v', 'type': 'function'}], function_call=None, reasoning_content='The user is asking me to add 5 + 3. I have access to a simple_add function that can add two numbers together. Let me check the parameters:\\n- a: first operand (required) - this would be 5\\n- b: second operand (default 0, optional) - this would be 3\\n\\nI have both values needed, so I can call the function.', thinking_blocks=[{'type': 'thinking', 'thinking': 'The user is asking me to add 5 + 3. I have access to a simple_add function that can add two numbers together. Let me check the parameters:\\n- a: first operand (required) - this would be 5\\n- b: second operand (default 0, optional) - this would be 3\\n\\nI have both values needed, so I can call the function.', 'signature': 'EtcDCkYIBxgCKkBsQpKkRzBiOdz/WsOaqhfLGR5Ek0wqybtz7oGGXAeA3v3R5xaFWOGSV2FqryJ8GFGwXVwi72lf159aKHKEeFegEgznHzdwjcISQRbx+AgaDAHewzC+gZsxWSyOviIwZ5a/EK+wqk6VMo2ul4EIY62/bK54isjBzFYYyN5oAuVYdkyClXYN713Z5Blp+jKfKr4CiNIHa9Hwy/7UK6L8S4rY/YF7rJvu2kZlz8wF5W8Vvl8VNHQHgeNygMgoXAamixxGPIgB98kR5cmY6IcVym0MMmQA4r4RxcAf8NjRdyksYB3Y4mszWr6Edtnr8v4BPjr3fQtxgOQVjiEXsMKKmNVJBGikVksm3r7x/1EDJ+rs+jI6WHCUWoNOEmu5XbrAqHDf06SmkrhF9NKvVC8rqQWi9hB5LEPR8oWsgpxHivdlbVmJqT7WV+V5779TmESIvBGl4aor1SSWM0muYh3pDY9n1wSY4DQvVQPM3bavZZJo9rvH39EA093Q6zSZhBFDII+QRN7O77rjSf9XVumOF09xtsHye8HKhjsYJfvPAOV2+NEthD3jYZI+rrBEHqkyLgnNaLlExxByTNxMytXlTIc42cB1FSDOJoXzd62pPdHVGAE='}], provider_specific_fields={'citations': None, 'thinking_blocks': [{'type': 'thinking', 'thinking': 'The user is asking me to add 5 + 3. I have access to a simple_add function that can add two numbers together. Let me check the parameters:\\n- a: first operand (required) - this would be 5\\n- b: second operand (default 0, optional) - this would be 3\\n\\nI have both values needed, so I can call the function.', 'signature': 'EtcDCkYIBxgCKkBsQpKkRzBiOdz/WsOaqhfLGR5Ek0wqybtz7oGGXAeA3v3R5xaFWOGSV2FqryJ8GFGwXVwi72lf159aKHKEeFegEgznHzdwjcISQRbx+AgaDAHewzC+gZsxWSyOviIwZ5a/EK+wqk6VMo2ul4EIY62/bK54isjBzFYYyN5oAuVYdkyClXYN713Z5Blp+jKfKr4CiNIHa9Hwy/7UK6L8S4rY/YF7rJvu2kZlz8wF5W8Vvl8VNHQHgeNygMgoXAamixxGPIgB98kR5cmY6IcVym0MMmQA4r4RxcAf8NjRdyksYB3Y4mszWr6Edtnr8v4BPjr3fQtxgOQVjiEXsMKKmNVJBGikVksm3r7x/1EDJ+rs+jI6WHCUWoNOEmu5XbrAqHDf06SmkrhF9NKvVC8rqQWi9hB5LEPR8oWsgpxHivdlbVmJqT7WV+V5779TmESIvBGl4aor1SSWM0muYh3pDY9n1wSY4DQvVQPM3bavZZJo9rvH39EA093Q6zSZhBFDII+QRN7O77rjSf9XVumOF09xtsHye8HKhjsYJfvPAOV2+NEthD3jYZI+rrBEHqkyLgnNaLlExxByTNxMytXlTIc42cB1FSDOJoXzd62pPdHVGAE='}]}))], usage=Usage(completion_tokens=165, prompt_tokens=455, total_tokens=620, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=81, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=None, role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 3}', 'name': 'simple_add'}, 'id': 'toolu_01QBLkGLtd85Yj8eEiFVBu4v', 'type': 'function'}], function_call=None, reasoning_content='The user is asking me to add 5 + 3. I have access to a simple_add function that can add two numbers together. Let me check the parameters:\\n- a: first operand (required) - this would be 5\\n- b: second operand (default 0, optional) - this would be 3\\n\\nI have both values needed, so I can call the function.', thinking_blocks=[{'type': 'thinking', 'thinking': 'The user is asking me to add 5 + 3. I have access to a simple_add function that can add two numbers together. Let me check the parameters:\\n- a: first operand (required) - this would be 5\\n- b: second operand (default 0, optional) - this would be 3\\n\\nI have both values needed, so I can call the function.', 'signature': 'EtcDCkYIBxgCKkBsQpKkRzBiOdz/WsOaqhfLGR5Ek0wqybtz7oGGXAeA3v3R5xaFWOGSV2FqryJ8GFGwXVwi72lf159aKHKEeFegEgznHzdwjcISQRbx+AgaDAHewzC+gZsxWSyOviIwZ5a/EK+wqk6VMo2ul4EIY62/bK54isjBzFYYyN5oAuVYdkyClXYN713Z5Blp+jKfKr4CiNIHa9Hwy/7UK6L8S4rY/YF7rJvu2kZlz8wF5W8Vvl8VNHQHgeNygMgoXAamixxGPIgB98kR5cmY6IcVym0MMmQA4r4RxcAf8NjRdyksYB3Y4mszWr6Edtnr8v4BPjr3fQtxgOQVjiEXsMKKmNVJBGikVksm3r7x/1EDJ+rs+jI6WHCUWoNOEmu5XbrAqHDf06SmkrhF9NKvVC8rqQWi9hB5LEPR8oWsgpxHivdlbVmJqT7WV+V5779TmESIvBGl4aor1SSWM0muYh3pDY9n1wSY4DQvVQPM3bavZZJo9rvH39EA093Q6zSZhBFDII+QRN7O77rjSf9XVumOF09xtsHye8HKhjsYJfvPAOV2+NEthD3jYZI+rrBEHqkyLgnNaLlExxByTNxMytXlTIc42cB1FSDOJoXzd62pPdHVGAE='}], provider_specific_fields={'citations': None, 'thinking_blocks': [{'type': 'thinking', 'thinking': 'The user is asking me to add 5 + 3. I have access to a simple_add function that can add two numbers together. Let me check the parameters:\\n- a: first operand (required) - this would be 5\\n- b: second operand (default 0, optional) - this would be 3\\n\\nI have both values needed, so I can call the function.', 'signature': 'EtcDCkYIBxgCKkBsQpKkRzBiOdz/WsOaqhfLGR5Ek0wqybtz7oGGXAeA3v3R5xaFWOGSV2FqryJ8GFGwXVwi72lf159aKHKEeFegEgznHzdwjcISQRbx+AgaDAHewzC+gZsxWSyOviIwZ5a/EK+wqk6VMo2ul4EIY62/bK54isjBzFYYyN5oAuVYdkyClXYN713Z5Blp+jKfKr4CiNIHa9Hwy/7UK6L8S4rY/YF7rJvu2kZlz8wF5W8Vvl8VNHQHgeNygMgoXAamixxGPIgB98kR5cmY6IcVym0MMmQA4r4RxcAf8NjRdyksYB3Y4mszWr6Edtnr8v4BPjr3fQtxgOQVjiEXsMKKmNVJBGikVksm3r7x/1EDJ+rs+jI6WHCUWoNOEmu5XbrAqHDf06SmkrhF9NKvVC8rqQWi9hB5LEPR8oWsgpxHivdlbVmJqT7WV+V5779TmESIvBGl4aor1SSWM0muYh3pDY9n1wSY4DQvVQPM3bavZZJo9rvH39EA093Q6zSZhBFDII+QRN7O77rjSf9XVumOF09xtsHye8HKhjsYJfvPAOV2+NEthD3jYZI+rrBEHqkyLgnNaLlExxByTNxMytXlTIc42cB1FSDOJoXzd62pPdHVGAE='}]}))], usage=Usage(completion_tokens=165, prompt_tokens=455, total_tokens=620, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=81, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "metadata": {}, @@ -2095,7 +2132,7 @@ "{'tool_call_id': 'toolu_01QBLkGLtd85Yj8eEiFVBu4v',\n", " 'role': 'tool',\n", " 'name': 'simple_add',\n", - " 'content': '8'}" + " 'content': [{'type': 'text', 'text': '8'}]}" ] }, "metadata": {}, @@ -2108,15 +2145,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-9eec29ad-78f8-44ec-8e26-3c86ef362f8d`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=12, prompt_tokens=633, total_tokens=645, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=12, prompt_tokens=633, total_tokens=645, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-9eec29ad-78f8-44ec-8e26-3c86ef362f8d', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='5 + 3 = 8', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=12, prompt_tokens=633, total_tokens=645, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='5 + 3 = 8', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=12, prompt_tokens=633, total_tokens=645, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "metadata": {}, @@ -2173,7 +2210,7 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-f24bc56c-fd12-47b8-ad0d-9b8ffe3a4b47`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", "- usage: `Usage(completion_tokens=551, prompt_tokens=13314, total_tokens=13865, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None)`\n", @@ -2181,7 +2218,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-f24bc56c-fd12-47b8-ad0d-9b8ffe3a4b47', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Otters are [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") charismatic members of the weasel family, found on every continent except Australia and Antarctica. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") There are 13-14 species in total, ranging from [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") the Asian small-clawed otter (smallest) to the giant otter and sea otter (largest).\\n\\nThese semi-aquatic mammals have [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") elongated bodies, long tails, and soft, dense fur. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") Otters have the densest fur of any animal鈥攁s many as a million hairs per square inch. They\\'re [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") equipped with powerful webbed feet for swimming and seal-like abilities for holding breath underwater, with [*](https://www.doi.gov/blog/12-facts-about-otters-sea-otter-awareness-week \"12 Facts About Otters for Sea Otter Awareness Week | U.S. Department of the Interior\") [*](https://www.pbs.org/wnet/nature/blog/otter-fact-sheet/ \"Otter Fact Sheet | Blog | Nature | PBS\") river otters able to hold their breath for up to 8 minutes.\\n\\n[*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") All otters are expert hunters that eat fish, crustaceans, and other critters. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") Sea otters have an ingenious method to open shellfish by floating on their backs, placing a rock on their chest, then smashing mollusks against it. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") River otters are especially playful, gamboling on land and splashing into rivers.\\n\\n[*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") Baby otters stay with their mothers until they\\'re up to a year old, and [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") otters can live up to 16 years. Unfortunately, [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") many species remain at risk from pollution and habitat loss after being extensively hunted for their fur.', role='assistant', tool_calls=[], function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=551, prompt_tokens=13314, total_tokens=13865, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Otters are [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") charismatic members of the weasel family, found on every continent except Australia and Antarctica. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") There are 13-14 species in total, ranging from [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") the Asian small-clawed otter (smallest) to the giant otter and sea otter (largest).\\n\\nThese semi-aquatic mammals have [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") elongated bodies, long tails, and soft, dense fur. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") Otters have the densest fur of any animal鈥攁s many as a million hairs per square inch. They\\'re [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") equipped with powerful webbed feet for swimming and seal-like abilities for holding breath underwater, with [*](https://www.doi.gov/blog/12-facts-about-otters-sea-otter-awareness-week \"12 Facts About Otters for Sea Otter Awareness Week | U.S. Department of the Interior\") [*](https://www.pbs.org/wnet/nature/blog/otter-fact-sheet/ \"Otter Fact Sheet | Blog | Nature | PBS\") river otters able to hold their breath for up to 8 minutes.\\n\\n[*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") All otters are expert hunters that eat fish, crustaceans, and other critters. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") Sea otters have an ingenious method to open shellfish by floating on their backs, placing a rock on their chest, then smashing mollusks against it. [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") River otters are especially playful, gamboling on land and splashing into rivers.\\n\\n[*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") Baby otters stay with their mothers until they\\'re up to a year old, and [*](https://en.wikipedia.org/wiki/Otter \"Otter - Wikipedia\") otters can live up to 16 years. Unfortunately, [*](https://www.nationalgeographic.com/animals/mammals/facts/otters-1 \"Otters, facts and information | National Geographic\") many species remain at risk from pollution and habitat loss after being extensively hunted for their fur.', role='assistant', tool_calls=[], function_call=None, provider_specific_fields=None))], usage=Usage(completion_tokens=551, prompt_tokens=13314, total_tokens=13865, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=None))" ] }, "metadata": {}, @@ -2231,15 +2268,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-62a9aee6-9640-476f-88a9-e1204eb56d4d`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `tool_calls`\n", - "- usage: `Usage(completion_tokens=96, prompt_tokens=434, total_tokens=530, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=96, prompt_tokens=434, total_tokens=530, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-62a9aee6-9640-476f-88a9-e1204eb56d4d', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=\"I'll solve this step by step using the addition function.\\n\\nFirst, let me calculate 5 + 3:\", role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 3}', 'name': 'simple_add'}, 'id': 'toolu_01PbJNpks9G6o9UYjRs5nd4b', 'type': 'function'}], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=96, prompt_tokens=434, total_tokens=530, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=[{'type': 'text', 'text': \"I'll solve this step by step using the addition function.\\n\\nFirst, let me calculate 5 + 3:\"}], role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 3}', 'name': 'simple_add'}, 'id': 'toolu_01PbJNpks9G6o9UYjRs5nd4b', 'type': 'function'}], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=96, prompt_tokens=434, total_tokens=530, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "metadata": {}, @@ -2251,7 +2288,7 @@ "{'tool_call_id': 'toolu_01PbJNpks9G6o9UYjRs5nd4b',\n", " 'role': 'tool',\n", " 'name': 'simple_add',\n", - " 'content': '8'}" + " 'content': [{'type': 'text', 'text': '8'}]}" ] }, "metadata": {}, @@ -2267,15 +2304,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-2605be30-dc87-44cf-b64d-f4549742c630`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `tool_calls`\n", - "- usage: `Usage(completion_tokens=88, prompt_tokens=543, total_tokens=631, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=88, prompt_tokens=543, total_tokens=631, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-2605be30-dc87-44cf-b64d-f4549742c630', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=\"Now I'll add 7 to that result (8 + 7):\", role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 8, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_01PAuvDwaBNgM2JbEwJwxov5', 'type': 'function'}], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=88, prompt_tokens=543, total_tokens=631, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=[{'type': 'text', 'text': \"Now I'll add 7 to that result (8 + 7):\"}], role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 8, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_01WvdZWmMQ8A1uLytBp4g999', 'type': 'function'}], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=88, prompt_tokens=543, total_tokens=631, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "metadata": {}, @@ -2284,10 +2321,10 @@ { "data": { "text/plain": [ - "{'tool_call_id': 'toolu_01PAuvDwaBNgM2JbEwJwxov5',\n", + "{'tool_call_id': 'toolu_01WvdZWmMQ8A1uLytBp4g999',\n", " 'role': 'tool',\n", " 'name': 'simple_add',\n", - " 'content': '15'}" + " 'content': [{'type': 'text', 'text': '15'}]}" ] }, "metadata": {}, @@ -2303,15 +2340,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-7d05c84b-9baf-4452-b5b6-037ee032378b`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `tool_calls`\n", - "- usage: `Usage(completion_tokens=89, prompt_tokens=644, total_tokens=733, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=89, prompt_tokens=644, total_tokens=733, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-7d05c84b-9baf-4452-b5b6-037ee032378b', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=\"Finally, I'll add 11 to that result (15 + 11):\", role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 15, \"b\": 11}', 'name': 'simple_add'}, 'id': 'toolu_01KeELPbBSpCePrk4c8EzbyB', 'type': 'function'}], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=89, prompt_tokens=644, total_tokens=733, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=[{'type': 'text', 'text': \"Finally, I'll add 11 to that result (15 + 11):\"}], role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 15, \"b\": 11}', 'name': 'simple_add'}, 'id': 'toolu_01EGKUGxjR6oELVhS5vdVFR7', 'type': 'function'}], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=89, prompt_tokens=644, total_tokens=733, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "metadata": {}, @@ -2320,10 +2357,10 @@ { "data": { "text/plain": [ - "{'tool_call_id': 'toolu_01KeELPbBSpCePrk4c8EzbyB',\n", + "{'tool_call_id': 'toolu_01EGKUGxjR6oELVhS5vdVFR7',\n", " 'role': 'tool',\n", " 'name': 'simple_add',\n", - " 'content': '26'}" + " 'content': [{'type': 'text', 'text': '26'}]}" ] }, "metadata": {}, @@ -2341,15 +2378,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-f0998cfb-8a86-468b-be17-346fba3a6973`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=68, prompt_tokens=746, total_tokens=814, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=68, prompt_tokens=746, total_tokens=814, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-f0998cfb-8a86-468b-be17-346fba3a6973', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='So working step by step:\\n- 5 + 3 = 8\\n- 8 + 7 = 15 \\n- 15 + 11 = 26\\n\\nTherefore, ((5 + 3) + 7) + 11 = **26**', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=68, prompt_tokens=746, total_tokens=814, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='So working step by step:\\n- 5 + 3 = 8\\n- 8 + 7 = 15 \\n- 15 + 11 = 26\\n\\nTherefore, ((5 + 3) + 7) + 11 = **26**', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=68, prompt_tokens=746, total_tokens=814, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "metadata": {}, @@ -2413,7 +2450,7 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-CGk1fLa7VA3Mc1PAqP3EC8cWeAYmI`\n", + "- id: `chatcmpl-xxx`\n", "- model: `gpt-4.1-2025-04-14`\n", "- finish_reason: `tool_calls`\n", "- usage: `Usage(completion_tokens=52, prompt_tokens=110, total_tokens=162, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None))`\n", @@ -2421,7 +2458,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-CGk1fLa7VA3Mc1PAqP3EC8cWeAYmI', created=1758106207, model='gpt-4.1-2025-04-14', object='chat.completion', system_fingerprint='fp_3502f4eb73', choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=None, role='assistant', tool_calls=[{'function': {'arguments': '{\"a\": 5, \"b\": 3}', 'name': 'simple_add'}, 'id': 'call_8ZH9yZH3N9TEmaIOmV6H81mU', 'type': 'function'}, {'function': {'arguments': '{\"a\": 7, \"b\": 2}', 'name': 'simple_add'}, 'id': 'call_uDxT76wyUI8WY9ugRPwCnlb9', 'type': 'function'}], function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={})], usage=Usage(completion_tokens=52, prompt_tokens=110, total_tokens=162, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)), service_tier='default')" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='gpt-4.1-2025-04-14', object='chat.completion', system_fingerprint='fp_daf5fcc80a', choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=None, role='assistant', tool_calls=[{'function': {'arguments': '{\"a\": 5, \"b\": 3}', 'name': 'simple_add'}, 'id': 'call_jN5HxRoN9WjUfmAYotbHiPPy', 'type': 'function'}, {'function': {'arguments': '{\"a\": 7, \"b\": 2}', 'name': 'simple_add'}, 'id': 'call_fcQcY0ZX8Os84FTa4Gc6XEve', 'type': 'function'}], function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={})], usage=Usage(completion_tokens=52, prompt_tokens=110, total_tokens=162, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)), service_tier='default')" ] }, "metadata": {}, @@ -2430,10 +2467,10 @@ { "data": { "text/plain": [ - "{'tool_call_id': 'call_8ZH9yZH3N9TEmaIOmV6H81mU',\n", + "{'tool_call_id': 'call_jN5HxRoN9WjUfmAYotbHiPPy',\n", " 'role': 'tool',\n", " 'name': 'simple_add',\n", - " 'content': '8'}" + " 'content': [{'type': 'text', 'text': '8'}]}" ] }, "metadata": {}, @@ -2442,10 +2479,10 @@ { "data": { "text/plain": [ - "{'tool_call_id': 'call_uDxT76wyUI8WY9ugRPwCnlb9',\n", + "{'tool_call_id': 'call_fcQcY0ZX8Os84FTa4Gc6XEve',\n", " 'role': 'tool',\n", " 'name': 'simple_add',\n", - " 'content': '9'}" + " 'content': [{'type': 'text', 'text': '9'}]}" ] }, "metadata": {}, @@ -2461,7 +2498,7 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-CGk1gcySPBO2WLk2NP0OmV6CmuWZ9`\n", + "- id: `chatcmpl-xxx`\n", "- model: `gpt-4.1-2025-04-14`\n", "- finish_reason: `tool_calls`\n", "- usage: `Usage(completion_tokens=17, prompt_tokens=178, total_tokens=195, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None))`\n", @@ -2469,7 +2506,7 @@ "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-CGk1gcySPBO2WLk2NP0OmV6CmuWZ9', created=1758106208, model='gpt-4.1-2025-04-14', object='chat.completion', system_fingerprint='fp_3502f4eb73', choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=None, role='assistant', tool_calls=[{'function': {'arguments': '{\"a\":8,\"b\":9}', 'name': 'multiply'}, 'id': 'call_Dm0jjJPQf2elRy4z7yBhOMf5', 'type': 'function'}], function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={})], usage=Usage(completion_tokens=17, prompt_tokens=178, total_tokens=195, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)), service_tier='default')" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='gpt-4.1-2025-04-14', object='chat.completion', system_fingerprint='fp_daf5fcc80a', choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=None, role='assistant', tool_calls=[{'function': {'arguments': '{\"a\":8,\"b\":9}', 'name': 'multiply'}, 'id': 'call_Uxq7VTqwF6lZ5zYSVBeuLkbM', 'type': 'function'}], function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={})], usage=Usage(completion_tokens=17, prompt_tokens=178, total_tokens=195, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)), service_tier='default')" ] }, "metadata": {}, @@ -2478,10 +2515,10 @@ { "data": { "text/plain": [ - "{'tool_call_id': 'call_Dm0jjJPQf2elRy4z7yBhOMf5',\n", + "{'tool_call_id': 'call_Uxq7VTqwF6lZ5zYSVBeuLkbM',\n", " 'role': 'tool',\n", " 'name': 'multiply',\n", - " 'content': '72'}" + " 'content': [{'type': 'text', 'text': '72'}]}" ] }, "metadata": {}, @@ -2490,21 +2527,21 @@ { "data": { "text/markdown": [ - "(5 + 3) = 8 and (7 + 2) = 9. Multiplying them together: 8 脳 9 = 72. \n", + "(5 + 3) = 8 and (7 + 2) = 9. Multiplying these together: 8 脳 9 = 72.\n", "\n", "So, (5 + 3) * (7 + 2) = 72.\n", "\n", "
\n", "\n", - "- id: `chatcmpl-CGk1htUXKeYdDxJf9BYj6ZfgbEw6l`\n", + "- id: `chatcmpl-xxx`\n", "- model: `gpt-4.1-2025-04-14`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=55, prompt_tokens=203, total_tokens=258, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None))`\n", + "- usage: `Usage(completion_tokens=54, prompt_tokens=203, total_tokens=257, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None))`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-CGk1htUXKeYdDxJf9BYj6ZfgbEw6l', created=1758106209, model='gpt-4.1-2025-04-14', object='chat.completion', system_fingerprint='fp_3502f4eb73', choices=[Choices(finish_reason='stop', index=0, message=Message(content='(5 + 3) = 8 and (7 + 2) = 9. Multiplying them together: 8 脳 9 = 72. \\n\\nSo, (5 + 3) * (7 + 2) = 72.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={})], usage=Usage(completion_tokens=55, prompt_tokens=203, total_tokens=258, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)), service_tier='default')" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='gpt-4.1-2025-04-14', object='chat.completion', system_fingerprint='fp_daf5fcc80a', choices=[Choices(finish_reason='stop', index=0, message=Message(content='(5 + 3) = 8 and (7 + 2) = 9. Multiplying these together: 8 脳 9 = 72.\\n\\nSo, (5 + 3) * (7 + 2) = 72.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={})], usage=Usage(completion_tokens=54, prompt_tokens=203, total_tokens=257, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)), service_tier='default')" ] }, "metadata": {}, @@ -2565,15 +2602,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-b482f2c1-7f28-4b8e-ab0e-5b68d46ab482`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `tool_calls`\n", - "- usage: `Usage(completion_tokens=116, prompt_tokens=608, total_tokens=724, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=116, prompt_tokens=608, total_tokens=724, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-b482f2c1-7f28-4b8e-ab0e-5b68d46ab482', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=\"I'll calculate this step by step using the available functions, following the order of operations (parentheses first, then multiplication/division from left to right).\\n\\nStep 1: Calculate (10 + 5)\", role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 10, \"b\": 5}', 'name': 'simple_add'}, 'id': 'toolu_01TsmBSiBevYHvSfCUirXFcY', 'type': 'function'}], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=116, prompt_tokens=608, total_tokens=724, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=[{'type': 'text', 'text': \"I'll calculate this step by step using the available functions, following the order of operations (parentheses first, then multiplication/division from left to right).\\n\\nStep 1: Calculate (10 + 5)\"}], role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 10, \"b\": 5}', 'name': 'simple_add'}, 'id': 'toolu_01TsmBSiBevYHvSfCUirXFcY', 'type': 'function'}], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=116, prompt_tokens=608, total_tokens=724, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "metadata": {}, @@ -2585,7 +2622,7 @@ "{'tool_call_id': 'toolu_01TsmBSiBevYHvSfCUirXFcY',\n", " 'role': 'tool',\n", " 'name': 'simple_add',\n", - " 'content': '15'}" + " 'content': [{'type': 'text', 'text': '15'}]}" ] }, "metadata": {}, @@ -2601,15 +2638,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-9814a218-d0a8-4eee-b422-f9aa0f261b95`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `tool_calls`\n", - "- usage: `Usage(completion_tokens=83, prompt_tokens=737, total_tokens=820, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=83, prompt_tokens=737, total_tokens=820, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-9814a218-d0a8-4eee-b422-f9aa0f261b95', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content='Step 2: Calculate (2 + 1)', role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 2, \"b\": 1}', 'name': 'simple_add'}, 'id': 'toolu_01HBq2SEjPxuG6JxXiduEca7', 'type': 'function'}], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=83, prompt_tokens=737, total_tokens=820, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=[{'type': 'text', 'text': 'Step 2: Calculate (2 + 1)'}], role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 2, \"b\": 1}', 'name': 'simple_add'}, 'id': 'toolu_013tpBAJas7hV8qM5S3QGCHY', 'type': 'function'}], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=83, prompt_tokens=737, total_tokens=820, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "metadata": {}, @@ -2618,10 +2655,10 @@ { "data": { "text/plain": [ - "{'tool_call_id': 'toolu_01HBq2SEjPxuG6JxXiduEca7',\n", + "{'tool_call_id': 'toolu_013tpBAJas7hV8qM5S3QGCHY',\n", " 'role': 'tool',\n", " 'name': 'simple_add',\n", - " 'content': '3'}" + " 'content': [{'type': 'text', 'text': '3'}]}" ] }, "metadata": {}, @@ -2645,15 +2682,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-171d691a-13be-492f-9175-e198afa025a7`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=111, prompt_tokens=847, total_tokens=958, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=111, prompt_tokens=847, total_tokens=958, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-171d691a-13be-492f-9175-e198afa025a7', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content=\"So far, I've calculated the expressions inside the parentheses:\\n\\n**Step 1:** (10 + 5) = 15\\n**Step 2:** (2 + 1) = 3\\n\\nNow the expression becomes: (15 * 3) / 3\\n\\nNext, I need to:\\n- Step 3: Multiply 15 * 3\\n- Step 4: Divide that result by 3\\n\\nWould you like me to continue with the remaining steps?\", role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=111, prompt_tokens=847, total_tokens=958, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content=\"So far, I've calculated the expressions inside the parentheses:\\n\\n**Step 1:** (10 + 5) = 15\\n**Step 2:** (2 + 1) = 3\\n\\nNow the expression becomes: (15 * 3) / 3\\n\\nNext, I need to:\\n- Step 3: Multiply 15 * 3\\n- Step 4: Divide that result by 3\\n\\nWould you like me to continue with the remaining steps?\", role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=111, prompt_tokens=847, total_tokens=958, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "metadata": {}, @@ -2813,15 +2850,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-ca11ab61-5780-4951-abfd-ebdcb9e0fe8f`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=13, prompt_tokens=14, total_tokens=27, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=13, prompt_tokens=14, total_tokens=27, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-ca11ab61-5780-4951-abfd-ebdcb9e0fe8f', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='2 + 2 = 4', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=13, prompt_tokens=14, total_tokens=27, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='2 + 2 = 4', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=13, prompt_tokens=14, total_tokens=27, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "execution_count": null, @@ -2872,15 +2909,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-8167d524-4a33-4c62-9ffd-4bb84271000f`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `tool_calls`\n", - "- usage: `Usage(completion_tokens=91, prompt_tokens=424, total_tokens=515, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=91, prompt_tokens=424, total_tokens=515, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-8167d524-4a33-4c62-9ffd-4bb84271000f', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=\"I'll use the async_add tool to calculate 5 + 7 for you.\", role='assistant', tool_calls=[ChatCompletionMessageToolCall(index=1, function=Function(arguments='{\"a\": 5, \"b\": 7}', name='async_add'), id='toolu_01X1GDcGawNLq77xytxEGDBw', type='function')], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=91, prompt_tokens=424, total_tokens=515, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=\"I'll use the async_add tool to calculate 5 + 7 for you.\", role='assistant', tool_calls=[ChatCompletionMessageToolCall(index=1, function=Function(arguments='{\"a\": 5, \"b\": 7}', name='async_add'), id='toolu_01X1GDcGawNLq77xytxEGDBw', type='function')], function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=91, prompt_tokens=424, total_tokens=515, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "metadata": {}, @@ -2905,15 +2942,15 @@ "\n", "
\n", "\n", - "- id: `chatcmpl-d5412482-a6ac-448e-8a68-c7ffc94e8cbf`\n", + "- id: `chatcmpl-xxx`\n", "- model: `claude-sonnet-4-20250514`\n", "- finish_reason: `stop`\n", - "- usage: `Usage(completion_tokens=17, prompt_tokens=528, total_tokens=545, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", + "- usage: `Usage(completion_tokens=17, prompt_tokens=528, total_tokens=545, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0)`\n", "\n", "
" ], "text/plain": [ - "ModelResponse(id='chatcmpl-d5412482-a6ac-448e-8a68-c7ffc94e8cbf', created=1758422571, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='The result of 5 + 7 is 12.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=17, prompt_tokens=528, total_tokens=545, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None, cache_creation_tokens=0, cache_creation_token_details=CacheCreationTokenDetails(ephemeral_5m_input_tokens=0, ephemeral_1h_input_tokens=0)), cache_creation_input_tokens=0, cache_read_input_tokens=0))" + "ModelResponse(id='chatcmpl-xxx', created=1000000000, model='claude-sonnet-4-20250514', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='The result of 5 + 7 is 12.', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None}))], usage=Usage(completion_tokens=17, prompt_tokens=528, total_tokens=545, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None), cache_creation_input_tokens=0, cache_read_input_tokens=0))" ] }, "metadata": {},