Skip to content

Commit a1a166e

Browse files
authored
Merge pull request #27 from AnswerDotAI/feat/26-make-nbs-deterministic
make tool call ids deterministic
2 parents db424f0 + b1b084a commit a1a166e

File tree

3 files changed

+34
-21
lines changed

3 files changed

+34
-21
lines changed

cachy.jsonl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,3 +323,10 @@
323323
{"key": "164efde8", "response": "{\"model\":\"claude-sonnet-4-5-20250929\",\"id\":\"msg_01Qw1nAA2ZdHP9homAt9RmEB\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"The answer is **12**. 5 + 7 = 12\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":812,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":20,\"service_tier\":\"standard\"}}"}
324324
{"key": "08f79923", "response": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"model\":\"claude-sonnet-4-5-20250929\",\"id\":\"msg_01N8JagzU6TFBduwSrWsuYRt\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":4,\"cache_creation_input_tokens\":1622,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":1622,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":1,\"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\":\"Hi\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" there! How can I help you today?\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":4,\"cache_creation_input_tokens\":1622,\"cache_read_input_tokens\":0,\"output_tokens\":13} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n"}
325325
{"key": "8c03dba1", "response": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"model\":\"claude-sonnet-4-5-20250929\",\"id\":\"msg_01GAgUtvEgpHj3obEmAAQPqW\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":4,\"cache_creation_input_tokens\":14,\"cache_read_input_tokens\":1622,\"cache_creation\":{\"ephemeral_5m_input_tokens\":14,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"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\":\"Goodbye!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" Feel free to come back if you have any\"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" questions.\"} }\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\":4,\"cache_creation_input_tokens\":14,\"cache_read_input_tokens\":1622,\"output_tokens\":17} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n"}
326+
{"key": "0c5b9a4b", "response": "{\"model\":\"claude-sonnet-4-5-20250929\",\"id\":\"msg_01WQxnGnMDNVqq934EAnbujT\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"The result of 5 + 7 is **12**.\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":720,\"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\"}}"}
327+
{"key": "447e5dd9", "response": "{\"model\":\"claude-sonnet-4-5-20250929\",\"id\":\"msg_01FCQN9wbC3E5RV5Ub8aq66a\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"The result of 5 + 7 is **12**.\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":720,\"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\"}}"}
328+
{"key": "b303447f", "response": "{\"model\":\"claude-sonnet-4-5-20250929\",\"id\":\"msg_01VfGec2mfAPEUU6dNQhLwTQ\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"The answer is **12**. 5 + 7 = 12\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":812,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":20,\"service_tier\":\"standard\"}}"}
329+
{"key": "76164dc7", "response": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"model\":\"claude-sonnet-4-5-20250929\",\"id\":\"msg_013BxehGdDyyjsGWLEWFxGwe\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":4,\"cache_creation_input_tokens\":1622,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":1622,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":1,\"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\":\"Hi\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" there! How can I help you today?\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":4,\"cache_creation_input_tokens\":1622,\"cache_read_input_tokens\":0,\"output_tokens\":13} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n"}
330+
{"key": "5c8485a6", "response": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"model\":\"claude-sonnet-4-5-20250929\",\"id\":\"msg_01FAdRVTQeQTovybY7EVW2Fr\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":4,\"cache_creation_input_tokens\":14,\"cache_read_input_tokens\":1622,\"cache_creation\":{\"ephemeral_5m_input_tokens\":14,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":9,\"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\":\"Goodbye! Feel free to come back if\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" you have any questions.\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":4,\"cache_creation_input_tokens\":14,\"cache_read_input_tokens\":1622,\"output_tokens\":17}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"}
331+
{"key": "fc5ede02", "response": "{\"model\":\"claude-sonnet-4-20250514\",\"id\":\"msg_01M2HV41ZonZ1AAJg5FUy6zr\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"\\n\\nThe result of 47 + 23 is 70.\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":573,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":18,\"service_tier\":\"standard\"}}"}
332+
{"key": "df4ef045", "response": "{\"model\":\"claude-sonnet-4-20250514\",\"id\":\"msg_0139iCPpDfH1itSAtoBGNV4V\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"\\n\\nThe answer is **129**.\\n\\nI calculated this by first adding 47 + 23 = 70, then adding 70 + 59 = 129.\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":702,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":41,\"service_tier\":\"standard\"}}"}

lisette/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from fastcore import imghdr
2121

2222
# %% ../nbs/00_core.ipynb
23-
def patch_litellm():
23+
def patch_litellm(seed=0):
2424
"Patch litellm.ModelResponseBase such that `id` and `created` are fixed."
2525
from litellm.types.utils import ModelResponseBase
2626
@patch
@@ -33,6 +33,8 @@ def __setattr__(self: ModelResponseBase, name, value):
3333
elif name == 'created': value = 1000000000
3434
self._orig___setattr__(name, value)
3535

36+
if seed is not None: random.seed(seed) # ensures random ids like tool call ids are deterministic
37+
3638
# %% ../nbs/00_core.ipynb
3739
@patch
3840
def _repr_markdown_(self: litellm.ModelResponse):

nbs/00_core.ipynb

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"outputs": [],
109109
"source": [
110110
"#| export\n",
111-
"def patch_litellm():\n",
111+
"def patch_litellm(seed=0):\n",
112112
" \"Patch litellm.ModelResponseBase such that `id` and `created` are fixed.\"\n",
113113
" from litellm.types.utils import ModelResponseBase\n",
114114
" @patch\n",
@@ -119,7 +119,9 @@
119119
" def __setattr__(self: ModelResponseBase, name, value):\n",
120120
" if name == 'id': value = 'chatcmpl-xxx'\n",
121121
" elif name == 'created': value = 1000000000\n",
122-
" self._orig___setattr__(name, value)"
122+
" self._orig___setattr__(name, value)\n",
123+
"\n",
124+
" if seed is not None: random.seed(seed) # ensures random ids like tool call ids are deterministic"
123125
]
124126
},
125127
{
@@ -2012,7 +2014,7 @@
20122014
{
20132015
"data": {
20142016
"text/plain": [
2015-
"'toolu_uGSrbSMWW0GImQFyEbrRj8Omp'"
2017+
"'toolu_0UAqFzWsDK4FrUMp48Y3tT3QD'"
20162018
]
20172019
},
20182020
"execution_count": null,
@@ -2058,7 +2060,7 @@
20582060
"text/plain": [
20592061
"{'index': 1,\n",
20602062
" 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'},\n",
2061-
" 'id': 'toolu_9UH5zWCU7UdQvyEklvJkxzHW6',\n",
2063+
" 'id': 'toolu_gAL47D1qXIaSyZPaE1pu1lJo7',\n",
20622064
" 'type': 'function'}"
20632065
]
20642066
},
@@ -2099,7 +2101,7 @@
20992101
{
21002102
"data": {
21012103
"text/plain": [
2102-
"Message(content=\"I'll use the simple_add tool to calculate 5 + 7 for you.\", role='assistant', tool_calls=[ChatCompletionMessageToolCall(index=1, function=Function(arguments='{\"a\": 5, \"b\": 7}', name='simple_add'), id='toolu_9UH5zWCU7UdQvyEklvJkxzHW6', type='function')], function_call=None, provider_specific_fields=None)"
2104+
"Message(content=\"I'll use the simple_add tool to calculate 5 + 7 for you.\", role='assistant', tool_calls=[ChatCompletionMessageToolCall(index=1, function=Function(arguments='{\"a\": 5, \"b\": 7}', name='simple_add'), id='toolu_gAL47D1qXIaSyZPaE1pu1lJo7', type='function')], function_call=None, provider_specific_fields=None)"
21032105
]
21042106
},
21052107
"execution_count": null,
@@ -2145,7 +2147,7 @@
21452147
{
21462148
"data": {
21472149
"text/plain": [
2148-
"Message(content=\"I'll use the simple_add tool to calculate 5 + 7 for you.\", role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_9UH5zWCU7UdQvyEklvJkxzHW6', 'type': 'function'}], function_call=None, provider_specific_fields=None)"
2150+
"Message(content=\"I'll use the simple_add tool to calculate 5 + 7 for you.\", role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_gAL47D1qXIaSyZPaE1pu1lJo7', 'type': 'function'}], function_call=None, provider_specific_fields=None)"
21492151
]
21502152
},
21512153
"execution_count": null,
@@ -2180,7 +2182,7 @@
21802182
"text": [
21812183
"{'role': 'user', 'content': 'What is 5 + 7? Use the tool to calculate it.'}\n",
21822184
"\n",
2183-
"Message(content=\"I'll use the simple_add tool to calculate 5 + 7 for you.\", role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_9UH5zWCU7UdQvyEklvJkxzHW6', 'type': 'function'}], function_call=None, provider_specific_fields=None)\n",
2185+
"Message(content=\"I'll use the simple_add tool to calculate 5 + 7 for you.\", role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_gAL47D1qXIaSyZPaE1pu1lJo7', 'type': 'function'}], function_call=None, provider_specific_fields=None)\n",
21842186
"\n"
21852187
]
21862188
}
@@ -2227,7 +2229,7 @@
22272229
"text/plain": [
22282230
"{'index': 1,\n",
22292231
" 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'},\n",
2230-
" 'id': 'toolu_9UH5zWCU7UdQvyEklvJkxzHW6',\n",
2232+
" 'id': 'toolu_gAL47D1qXIaSyZPaE1pu1lJo7',\n",
22312233
" 'type': 'function'}"
22322234
]
22332235
},
@@ -2249,7 +2251,7 @@
22492251
{
22502252
"data": {
22512253
"text/plain": [
2252-
"{'tool_call_id': 'toolu_9UH5zWCU7UdQvyEklvJkxzHW6',\n",
2254+
"{'tool_call_id': 'toolu_gAL47D1qXIaSyZPaE1pu1lJo7',\n",
22532255
" 'role': 'tool',\n",
22542256
" 'name': 'simple_add',\n",
22552257
" 'content': '12'}"
@@ -2292,7 +2294,7 @@
22922294
{
22932295
"data": {
22942296
"text/plain": [
2295-
"Message(content=\"I'll use the simple_add tool to calculate 5 + 7 for you.\", role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_cuVdHN21LcyRt6MOrWsT2UKGU', 'type': 'function'}], function_call=None, provider_specific_fields=None)"
2297+
"Message(content=\"I'll use the simple_add tool to calculate 5 + 7 for you.\", role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_gAL47D1qXIaSyZPaE1pu1lJo7', 'type': 'function'}], function_call=None, provider_specific_fields=None)"
22962298
]
22972299
},
22982300
"execution_count": null,
@@ -2313,7 +2315,7 @@
23132315
{
23142316
"data": {
23152317
"text/plain": [
2316-
"[{'tool_call_id': 'toolu_cuVdHN21LcyRt6MOrWsT2UKGU',\n",
2318+
"[{'tool_call_id': 'toolu_gAL47D1qXIaSyZPaE1pu1lJo7',\n",
23172319
" 'role': 'tool',\n",
23182320
" 'name': 'simple_add',\n",
23192321
" 'content': '12'}]"
@@ -2382,9 +2384,9 @@
23822384
"text": [
23832385
"{'role': 'user', 'content': 'What is 5 + 7? Use the tool to calculate it.'}\n",
23842386
"\n",
2385-
"Message(content=\"I'll use the simple_add tool to calculate 5 + 7 for you.\", role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_cuVdHN21LcyRt6MOrWsT2UKGU', 'type': 'function'}], function_call=None, provider_specific_fields=None)\n",
2387+
"Message(content=\"I'll use the simple_add tool to calculate 5 + 7 for you.\", role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_gAL47D1qXIaSyZPaE1pu1lJo7', 'type': 'function'}], function_call=None, provider_specific_fields=None)\n",
23862388
"\n",
2387-
"{'tool_call_id': 'toolu_cuVdHN21LcyRt6MOrWsT2UKGU', 'role': 'tool', 'name': 'simple_add', 'content': '12'}\n",
2389+
"{'tool_call_id': 'toolu_gAL47D1qXIaSyZPaE1pu1lJo7', 'role': 'tool', 'name': 'simple_add', 'content': '12'}\n",
23882390
"\n",
23892391
"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})\n",
23902392
"\n"
@@ -2422,7 +2424,7 @@
24222424
{
24232425
"data": {
24242426
"text/plain": [
2425-
"[{'tool_call_id': 'toolu_cuVdHN21LcyRt6MOrWsT2UKGU',\n",
2427+
"[{'tool_call_id': 'toolu_gAL47D1qXIaSyZPaE1pu1lJo7',\n",
24262428
" 'role': 'tool',\n",
24272429
" 'name': 'simple_add',\n",
24282430
" 'content': '13'}]"
@@ -2498,7 +2500,7 @@
24982500
{
24992501
"data": {
25002502
"text/plain": [
2501-
"Message(content='I will calculate these for you!', role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_qretEWrUWV7xLLLIJbUV2257H', 'type': 'function'}, {'index': 1, 'function': {'arguments': '{\"a\": 6, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_uRfaA9XJcaKJtRX81UZwXZAP0', 'type': 'function'}], function_call=None, provider_specific_fields=None)"
2503+
"Message(content='I will calculate these for you!', role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_XBetF5gIRHYH7LKBKxJsllLOD', 'type': 'function'}, {'index': 1, 'function': {'arguments': '{\"a\": 6, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_fU25035HyRrY03K6JBO94XfLE', 'type': 'function'}], function_call=None, provider_specific_fields=None)"
25022504
]
25032505
},
25042506
"execution_count": null,
@@ -2576,11 +2578,11 @@
25762578
"text": [
25772579
"{'role': 'user', 'content': 'What is 5 + 7? Use the tool to calculate it.'}\n",
25782580
"\n",
2579-
"Message(content='I will calculate these for you!', role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_qretEWrUWV7xLLLIJbUV2257H', 'type': 'function'}, {'index': 1, 'function': {'arguments': '{\"a\": 6, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_uRfaA9XJcaKJtRX81UZwXZAP0', 'type': 'function'}], function_call=None, provider_specific_fields=None)\n",
2581+
"Message(content='I will calculate these for you!', role='assistant', tool_calls=[{'index': 1, 'function': {'arguments': '{\"a\": 5, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_XBetF5gIRHYH7LKBKxJsllLOD', 'type': 'function'}, {'index': 1, 'function': {'arguments': '{\"a\": 6, \"b\": 7}', 'name': 'simple_add'}, 'id': 'toolu_fU25035HyRrY03K6JBO94XfLE', 'type': 'function'}], function_call=None, provider_specific_fields=None)\n",
25802582
"\n",
2581-
"{'tool_call_id': 'toolu_qretEWrUWV7xLLLIJbUV2257H', 'role': 'tool', 'name': 'simple_add', 'content': '12'}\n",
2583+
"{'tool_call_id': 'toolu_XBetF5gIRHYH7LKBKxJsllLOD', 'role': 'tool', 'name': 'simple_add', 'content': '12'}\n",
25822584
"\n",
2583-
"{'tool_call_id': 'toolu_uRfaA9XJcaKJtRX81UZwXZAP0', 'role': 'tool', 'name': 'simple_add', 'content': '13'}\n",
2585+
"{'tool_call_id': 'toolu_fU25035HyRrY03K6JBO94XfLE', 'role': 'tool', 'name': 'simple_add', 'content': '13'}\n",
25842586
"\n",
25852587
"Message(content='The answer is **12**. 5 + 7 = 12', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'citations': None, 'thinking_blocks': None})\n",
25862588
"\n"
@@ -4467,8 +4469,10 @@
44674469
}
44684470
],
44694471
"metadata": {
4470-
"language_info": {
4471-
"name": "python"
4472+
"kernelspec": {
4473+
"display_name": "python3",
4474+
"language": "python",
4475+
"name": "python3"
44724476
}
44734477
},
44744478
"nbformat": 4,

0 commit comments

Comments
 (0)