Skip to content

Commit b0a97f1

Browse files
committed
temporarily remove tool calls
1 parent 56068f0 commit b0a97f1

1 file changed

Lines changed: 52 additions & 52 deletions

File tree

nbs/00_core.ipynb

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,11 +1236,11 @@
12361236
}
12371237
],
12381238
"source": [
1239-
"for m in ms:\n",
1240-
" display(f'=== {m} ===')\n",
1241-
" chat = Chat(m, tools=[simple_add])\n",
1242-
" res = chat(\"What's 5 + 3?\")\n",
1243-
" display(res)"
1239+
"# for m in ms:\n",
1240+
"# display(f'=== {m} ===')\n",
1241+
"# chat = Chat(m, tools=[simple_add])\n",
1242+
"# res = chat(\"What's 5 + 3?\")\n",
1243+
"# display(res)"
12441244
]
12451245
},
12461246
{
@@ -1287,11 +1287,11 @@
12871287
}
12881288
],
12891289
"source": [
1290-
"chat = Chat(ms[1], tools=[search_tool])\n",
1291-
"res = chat(\"Search the web and tell me very briefly about otters\", stream=True)\n",
1292-
"for o in res:\n",
1293-
" if isinstance(o, ModelResponse): sleep(0.01); display(o)\n",
1294-
" else: print(delta_text(o) or '',end='')"
1290+
"# chat = Chat(ms[1], tools=[search_tool])\n",
1291+
"# res = chat(\"Search the web and tell me very briefly about otters\", stream=True)\n",
1292+
"# for o in res:\n",
1293+
"# if isinstance(o, ModelResponse): sleep(0.01); display(o)\n",
1294+
"# else: print(delta_text(o) or '',end='')"
12951295
]
12961296
},
12971297
{
@@ -1455,9 +1455,9 @@
14551455
}
14561456
],
14571457
"source": [
1458-
"chat = Chat(model, tools=[simple_add])\n",
1459-
"res = chat(\"What's ((5 + 3)+7)+11? Work step by step\", return_all=True, max_tool_rounds=5)\n",
1460-
"for r in res: display(r)"
1458+
"# chat = Chat(model, tools=[simple_add])\n",
1459+
"# res = chat(\"What's ((5 + 3)+7)+11? Work step by step\", return_all=True, max_tool_rounds=5)\n",
1460+
"# for r in res: display(r)"
14611461
]
14621462
},
14631463
{
@@ -1610,14 +1610,14 @@
16101610
}
16111611
],
16121612
"source": [
1613-
"def multiply(a: int, b: int) -> int:\n",
1614-
" \"Multiply two numbers\"\n",
1615-
" print(f\"MULTIPLY: {a} * {b}\")\n",
1616-
" return a * b\n",
1613+
"# def multiply(a: int, b: int) -> int:\n",
1614+
"# \"Multiply two numbers\"\n",
1615+
"# print(f\"MULTIPLY: {a} * {b}\")\n",
1616+
"# return a * b\n",
16171617
"\n",
1618-
"chat = Chat(ms[-1], tools=[simple_add, multiply])\n",
1619-
"res = chat(\"Calculate (5 + 3) * (7 + 2)\", max_tool_rounds=5, return_all=True)\n",
1620-
"for r in res: display(r)"
1618+
"# chat = Chat(ms[-1], tools=[simple_add, multiply])\n",
1619+
"# res = chat(\"Calculate (5 + 3) * (7 + 2)\", max_tool_rounds=5, return_all=True)\n",
1620+
"# for r in res: display(r)"
16211621
]
16221622
},
16231623
{
@@ -1759,17 +1759,17 @@
17591759
}
17601760
],
17611761
"source": [
1762-
"def divide(a: int, b: int) -> float:\n",
1763-
" \"Divide two numbers\"\n",
1764-
" display(f\"DIVIDE: {a} / {b}\")\n",
1765-
" return a / b\n",
1762+
"# def divide(a: int, b: int) -> float:\n",
1763+
"# \"Divide two numbers\"\n",
1764+
"# display(f\"DIVIDE: {a} / {b}\")\n",
1765+
"# return a / b\n",
17661766
"\n",
1767-
"chat = Chat(model, tools=[simple_add, multiply, divide])\n",
1768-
"res = chat(\"Calculate ((10 + 5) * 3) / (2 + 1) step by step\", \n",
1769-
" max_tool_rounds=2, return_all=True,\n",
1770-
" final_prompt=\"Please summarize what you've calculated so far\")\n",
1771-
"print(f\"Got {len(res)} responses\")\n",
1772-
"for r in res: display(r)"
1767+
"# chat = Chat(model, tools=[simple_add, multiply, divide])\n",
1768+
"# res = chat(\"Calculate ((10 + 5) * 3) / (2 + 1) step by step\", \n",
1769+
"# max_tool_rounds=2, return_all=True,\n",
1770+
"# final_prompt=\"Please summarize what you've calculated so far\")\n",
1771+
"# print(f\"Got {len(res)} responses\")\n",
1772+
"# for r in res: display(r)"
17731773
]
17741774
},
17751775
{
@@ -1912,8 +1912,8 @@
19121912
}
19131913
],
19141914
"source": [
1915-
"chat = AsyncChat(model=\"claude-sonnet-4-20250514\")\n",
1916-
"await chat(\"What is 2+2?\")"
1915+
"# chat = AsyncChat(model=\"claude-sonnet-4-20250514\")\n",
1916+
"# await chat(\"What is 2+2?\")"
19171917
]
19181918
},
19191919
{
@@ -2002,9 +2002,9 @@
20022002
}
20032003
],
20042004
"source": [
2005-
"chat_with_tools = AsyncChat(model=\"claude-sonnet-4-20250514\", tools=[async_add])\n",
2006-
"res = await chat_with_tools(\"What is 5 + 7? Use the tool to calculate it.\", return_all=True)\n",
2007-
"async for r in res: display(r)"
2005+
"# chat_with_tools = AsyncChat(model=\"claude-sonnet-4-20250514\", tools=[async_add])\n",
2006+
"# res = await chat_with_tools(\"What is 5 + 7? Use the tool to calculate it.\", return_all=True)\n",
2007+
"# async for r in res: display(r)"
20082008
]
20092009
},
20102010
{
@@ -2033,11 +2033,11 @@
20332033
}
20342034
],
20352035
"source": [
2036-
"chat_with_tools = AsyncChat(model=\"claude-sonnet-4-20250514\", tools=[async_add])\n",
2037-
"res = await chat_with_tools(\"What is 5 + 7? Use the tool to calculate it.\", stream=True)\n",
2038-
"async for o in res: \n",
2039-
" if isinstance(o,ModelResponseStream): print(delta_text(o) or '',end='')\n",
2040-
" elif isinstance(o,dict): print(o)"
2036+
"# chat_with_tools = AsyncChat(model=\"claude-sonnet-4-20250514\", tools=[async_add])\n",
2037+
"# res = await chat_with_tools(\"What is 5 + 7? Use the tool to calculate it.\", stream=True)\n",
2038+
"# async for o in res: \n",
2039+
"# if isinstance(o,ModelResponseStream): print(delta_text(o) or '',end='')\n",
2040+
"# elif isinstance(o,dict): print(o)"
20412041
]
20422042
},
20432043
{
@@ -2104,11 +2104,11 @@
21042104
}
21052105
],
21062106
"source": [
2107-
"chat = AsyncChat(model=\"claude-sonnet-4-20250514\")\n",
2108-
"res = await chat(\"What's the most efficient way to sort a list of 1000 random integers?\", think='l',stream=True)\n",
2109-
"async for o in res: \n",
2110-
" if isinstance(o,ModelResponseStream): print(delta_text(o) or '',end='')\n",
2111-
" elif isinstance(o,dict): print(o)"
2107+
"# chat = AsyncChat(model=\"claude-sonnet-4-20250514\")\n",
2108+
"# res = await chat(\"What's the most efficient way to sort a list of 1000 random integers?\", think='l',stream=True)\n",
2109+
"# async for o in res: \n",
2110+
"# if isinstance(o,ModelResponseStream): print(delta_text(o) or '',end='')\n",
2111+
"# elif isinstance(o,dict): print(o)"
21122112
]
21132113
},
21142114
{
@@ -2143,13 +2143,13 @@
21432143
}
21442144
],
21452145
"source": [
2146-
"chat_stream_tools = AsyncChat(model=\"claude-sonnet-4-20250514\", tools=[search_tool])\n",
2147-
"res = await chat_stream_tools(\"Search the web and tell me very briefly about otters\", stream=True)\n",
2148-
"outp = ''\n",
2149-
"async for o in res: \n",
2150-
" if isinstance(o,ModelResponseStream): outp+=delta_text(o) or ''\n",
2151-
" elif isinstance(o,dict): outp+=str(o)+'\\n'\n",
2152-
" display(Markdown(outp),clear=True)"
2146+
"# chat_stream_tools = AsyncChat(model=\"claude-sonnet-4-20250514\", tools=[search_tool])\n",
2147+
"# res = await chat_stream_tools(\"Search the web and tell me very briefly about otters\", stream=True)\n",
2148+
"# outp = ''\n",
2149+
"# async for o in res: \n",
2150+
"# if isinstance(o,ModelResponseStream): outp+=delta_text(o) or ''\n",
2151+
"# elif isinstance(o,dict): outp+=str(o)+'\\n'\n",
2152+
"# display(Markdown(outp),clear=True)"
21532153
]
21542154
},
21552155
{

0 commit comments

Comments
 (0)