Skip to content

Commit

Permalink
Fix issue 1440 by applying new function registration decorator (#1661)
Browse files Browse the repository at this point in the history
* Reproduce #1440

* Updated code with latest APIs

* Reran notebook

* Fix usage of cache
  • Loading branch information
thinkall authored Feb 18, 2024
1 parent 9de374a commit 5aee911
Show file tree
Hide file tree
Showing 5 changed files with 601 additions and 254 deletions.
3 changes: 2 additions & 1 deletion notebook/agentchat_function_call.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,12 @@
}
],
"source": [
"with Cache.disk():\n",
"with Cache.disk() as cache:\n",
" # start the conversation\n",
" user_proxy.initiate_chat(\n",
" chatbot,\n",
" message=\"Draw two agents chatting with each other with an example dialog. Don't add plt.show().\",\n",
" cache=cache,\n",
" )"
]
},
Expand Down
6 changes: 4 additions & 2 deletions notebook/agentchat_function_call_async.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@
}
],
"source": [
"with Cache.disk():\n",
"with Cache.disk() as cache:\n",
" await user_proxy.a_initiate_chat( # noqa: F704\n",
" coder,\n",
" message=\"Create a timer for 5 seconds and then a stopwatch for 5 seconds.\",\n",
" cache=cache,\n",
" )"
]
},
Expand Down Expand Up @@ -347,10 +348,11 @@
"3) when 1 and 2 are done, terminate the group chat\n",
"\"\"\"\n",
"\n",
"with Cache.disk():\n",
"with Cache.disk() as cache:\n",
" await user_proxy.a_initiate_chat( # noqa: F704\n",
" manager,\n",
" message=message,\n",
" cache=cache,\n",
" )"
]
},
Expand Down
11 changes: 6 additions & 5 deletions notebook/agentchat_function_call_currency_calculator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@
}
],
"source": [
"with Cache.disk():\n",
"with Cache.disk() as cache:\n",
" # start the conversation\n",
" res = user_proxy.initiate_chat(\n",
" chatbot, message=\"How much is 123.45 USD in EUR?\", summary_method=\"reflection_with_llm\"\n",
" chatbot, message=\"How much is 123.45 USD in EUR?\", summary_method=\"reflection_with_llm\", cache=cache\n",
" )"
]
},
Expand Down Expand Up @@ -485,10 +485,10 @@
}
],
"source": [
"with Cache.disk():\n",
"with Cache.disk() as cache:\n",
" # start the conversation\n",
" res = user_proxy.initiate_chat(\n",
" chatbot, message=\"How much is 112.23 Euros in US Dollars?\", summary_method=\"reflection_with_llm\"\n",
" chatbot, message=\"How much is 112.23 Euros in US Dollars?\", summary_method=\"reflection_with_llm\", cache=cache\n",
" )"
]
},
Expand Down Expand Up @@ -563,11 +563,12 @@
}
],
"source": [
"with Cache.disk():\n",
"with Cache.disk() as cache:\n",
" # start the conversation\n",
" res = user_proxy.initiate_chat(\n",
" chatbot,\n",
" message=\"How much is 123.45 US Dollars in Euros?\",\n",
" cache=cache,\n",
" )"
]
},
Expand Down
Loading

0 comments on commit 5aee911

Please sign in to comment.