|
61 | 61 | },
|
62 | 62 | {
|
63 | 63 | "cell_type": "code",
|
64 |
| - "execution_count": 5, |
| 64 | + "execution_count": 1, |
65 | 65 | "id": "dca301a4",
|
66 | 66 | "metadata": {},
|
67 | 67 | "outputs": [],
|
|
119 | 119 | },
|
120 | 120 | {
|
121 | 121 | "cell_type": "code",
|
122 |
| - "execution_count": 6, |
| 122 | + "execution_count": 2, |
123 | 123 | "id": "9fb85afb",
|
124 | 124 | "metadata": {},
|
125 | 125 | "outputs": [
|
|
134 | 134 | "--------------------------------------------------------------------------------\n",
|
135 | 135 | "\u001b[33mchatbot\u001b[0m (to user_proxy):\n",
|
136 | 136 | "\n",
|
137 |
| - "\u001b[32m***** Suggested tool Call (call_mZqUtVEf6hwarnCqdiKtVhAE): timer *****\u001b[0m\n", |
| 137 | + "\u001b[32m***** Suggested tool Call (call_fGgH8U261nOnx3JGNJWslhh6): timer *****\u001b[0m\n", |
138 | 138 | "Arguments: \n",
|
139 |
| - "{\n", |
140 |
| - " \"num_seconds\": \"5\"\n", |
141 |
| - "}\n", |
| 139 | + "{\"num_seconds\":\"5\"}\n", |
142 | 140 | "\u001b[32m**********************************************************************\u001b[0m\n",
|
143 | 141 | "\n",
|
144 | 142 | "--------------------------------------------------------------------------------\n",
|
145 | 143 | "\u001b[35m\n",
|
146 |
| - ">>>>>>>> EXECUTING ASYNC FUNCTION timer...\u001b[0m\n" |
147 |
| - ] |
148 |
| - }, |
149 |
| - { |
150 |
| - "name": "stdout", |
151 |
| - "output_type": "stream", |
152 |
| - "text": [ |
| 144 | + ">>>>>>>> EXECUTING ASYNC FUNCTION timer...\u001b[0m\n", |
153 | 145 | "\u001b[33muser_proxy\u001b[0m (to chatbot):\n",
|
154 | 146 | "\n",
|
155 | 147 | "\u001b[33muser_proxy\u001b[0m (to chatbot):\n",
|
|
161 | 153 | "--------------------------------------------------------------------------------\n",
|
162 | 154 | "\u001b[33mchatbot\u001b[0m (to user_proxy):\n",
|
163 | 155 | "\n",
|
164 |
| - "\u001b[32m***** Suggested tool Call (call_xHz73PpH4ipdv7kTxK2AiVCf): stopwatch *****\u001b[0m\n", |
| 156 | + "\u001b[32m***** Suggested tool Call (call_BZs6ynF8gtcZKhONiIRZkECB): stopwatch *****\u001b[0m\n", |
165 | 157 | "Arguments: \n",
|
166 |
| - "{\n", |
167 |
| - " \"num_seconds\": \"5\"\n", |
168 |
| - "}\n", |
| 158 | + "{\"num_seconds\":\"5\"}\n", |
169 | 159 | "\u001b[32m**************************************************************************\u001b[0m\n",
|
170 | 160 | "\n",
|
171 | 161 | "--------------------------------------------------------------------------------\n",
|
|
195 | 185 | "\n",
|
196 | 186 | "coder = autogen.AssistantAgent(\n",
|
197 | 187 | " name=\"chatbot\",\n",
|
198 |
| - " system_message=\"For coding tasks, only use the functions you have been provided with. Reply TERMINATE when the task is done.\",\n", |
| 188 | + " system_message=\"For coding tasks, only use the functions you have been provided with. You have a stopwatch and a timer, these tools can and should be used in parallel. Reply TERMINATE when the task is done.\",\n", |
199 | 189 | " llm_config=llm_config,\n",
|
200 | 190 | ")\n",
|
201 | 191 | "\n",
|
|
253 | 243 | },
|
254 | 244 | {
|
255 | 245 | "cell_type": "code",
|
256 |
| - "execution_count": 7, |
| 246 | + "execution_count": 3, |
257 | 247 | "id": "2472f95c",
|
258 | 248 | "metadata": {},
|
259 | 249 | "outputs": [],
|
|
288 | 278 | },
|
289 | 279 | {
|
290 | 280 | "cell_type": "code",
|
291 |
| - "execution_count": 8, |
| 281 | + "execution_count": 4, |
292 | 282 | "id": "e2c9267a",
|
293 | 283 | "metadata": {},
|
294 | 284 | "outputs": [
|
|
299 | 289 | "\u001b[33muser_proxy\u001b[0m (to chat_manager):\n",
|
300 | 290 | "\n",
|
301 | 291 | "\n",
|
302 |
| - "1) Create a timer for 5 seconds.\n", |
303 |
| - "2) a stopwatch for 5 seconds.\n", |
304 |
| - "3) Pretty print the result as md.\n", |
305 |
| - "4) when 1-3 are done, terminate the group chat\n", |
306 |
| - "\n", |
307 |
| - "--------------------------------------------------------------------------------\n", |
308 |
| - "\u001b[33muser_proxy\u001b[0m (to chat_manager):\n", |
309 |
| - "\n", |
310 |
| - "\n", |
| 292 | + "1) Create a timer and a stopwatch for 5 seconds each in parallel.\n", |
| 293 | + "2) Pretty print the result as md.\n", |
| 294 | + "3) when 1 and 2 are done, terminate the group chat\n", |
311 | 295 | "\n",
|
312 | 296 | "--------------------------------------------------------------------------------\n",
|
313 | 297 | "\u001b[33mchatbot\u001b[0m (to chat_manager):\n",
|
314 | 298 | "\n",
|
315 |
| - "\u001b[32m***** Suggested tool Call (call_rdYofiAgFpRfaZaCT4tzAhOb): timer *****\u001b[0m\n", |
| 299 | + "\u001b[32m***** Suggested tool Call (call_zlHKR9LBzCqs1iLId5kvNvJ5): timer *****\u001b[0m\n", |
316 | 300 | "Arguments: \n",
|
317 |
| - "{\n", |
318 |
| - " \"num_seconds\": \"5\"\n", |
319 |
| - "}\n", |
| 301 | + "{\"num_seconds\": \"5\"}\n", |
320 | 302 | "\u001b[32m**********************************************************************\u001b[0m\n",
|
| 303 | + "\u001b[32m***** Suggested tool Call (call_rH1dgbS9itiJO1Gwnxxhcm35): stopwatch *****\u001b[0m\n", |
| 304 | + "Arguments: \n", |
| 305 | + "{\"num_seconds\": \"5\"}\n", |
| 306 | + "\u001b[32m**************************************************************************\u001b[0m\n", |
321 | 307 | "\n",
|
322 | 308 | "--------------------------------------------------------------------------------\n",
|
323 | 309 | "\u001b[35m\n",
|
324 | 310 | ">>>>>>>> EXECUTING ASYNC FUNCTION timer...\u001b[0m\n",
|
| 311 | + "\u001b[35m\n", |
| 312 | + ">>>>>>>> EXECUTING ASYNC FUNCTION stopwatch...\u001b[0m\n", |
325 | 313 | "\u001b[33muser_proxy\u001b[0m (to chat_manager):\n",
|
326 | 314 | "\n",
|
327 | 315 | "\u001b[33muser_proxy\u001b[0m (to chat_manager):\n",
|
|
333 | 321 | "--------------------------------------------------------------------------------\n",
|
334 | 322 | "\u001b[33muser_proxy\u001b[0m (to chat_manager):\n",
|
335 | 323 | "\n",
|
336 |
| - "\n", |
| 324 | + "\u001b[32m***** Response from calling tool \"stopwatch\" *****\u001b[0m\n", |
| 325 | + "Stopwatch is done!\n", |
| 326 | + "\u001b[32m**************************************************\u001b[0m\n", |
337 | 327 | "\n",
|
338 | 328 | "--------------------------------------------------------------------------------\n",
|
339 |
| - "\u001b[33muser_proxy\u001b[0m (to chat_manager):\n", |
| 329 | + "\u001b[33mMarkdown_agent\u001b[0m (to chat_manager):\n", |
| 330 | + "\n", |
| 331 | + "The results of the timer and stopwatch are as follows:\n", |
340 | 332 | "\n",
|
| 333 | + "- Timer: Timer is done!\n", |
| 334 | + "- Stopwatch: Stopwatch is done!\n", |
341 | 335 | "\n",
|
| 336 | + "Now, I will proceed to terminate the group chat.\n", |
| 337 | + "\u001b[32m***** Suggested tool Call (call_3Js7oU80vPatnA8IiaKXB5Xu): terminate_group_chat *****\u001b[0m\n", |
| 338 | + "Arguments: \n", |
| 339 | + "{\"message\":\"The session has concluded, and the group chat will now be terminated.\"}\n", |
| 340 | + "\u001b[32m*************************************************************************************\u001b[0m\n", |
342 | 341 | "\n",
|
343 | 342 | "--------------------------------------------------------------------------------\n",
|
| 343 | + "\u001b[35m\n", |
| 344 | + ">>>>>>>> EXECUTING ASYNC FUNCTION terminate_group_chat...\u001b[0m\n", |
344 | 345 | "\u001b[33muser_proxy\u001b[0m (to chat_manager):\n",
|
345 | 346 | "\n",
|
| 347 | + "\u001b[33muser_proxy\u001b[0m (to chat_manager):\n", |
346 | 348 | "\n",
|
| 349 | + "\u001b[32m***** Response from calling tool \"terminate_group_chat\" *****\u001b[0m\n", |
| 350 | + "[GROUPCHAT_TERMINATE] The session has concluded, and the group chat will now be terminated.\n", |
| 351 | + "\u001b[32m*************************************************************\u001b[0m\n", |
347 | 352 | "\n",
|
348 | 353 | "--------------------------------------------------------------------------------\n"
|
349 | 354 | ]
|
|
354 | 359 | "await user_proxy.a_initiate_chat( # noqa: F704\n",
|
355 | 360 | " manager,\n",
|
356 | 361 | " message=\"\"\"\n",
|
357 |
| - "1) Create a timer for 5 seconds.\n", |
358 |
| - "2) a stopwatch for 5 seconds.\n", |
359 |
| - "3) Pretty print the result as md.\n", |
360 |
| - "4) when 1-3 are done, terminate the group chat\"\"\",\n", |
| 362 | + "1) Create a timer and a stopwatch for 5 seconds each in parallel.\n", |
| 363 | + "2) Pretty print the result as md.\n", |
| 364 | + "3) when 1 and 2 are done, terminate the group chat\"\"\",\n", |
361 | 365 | ")"
|
362 | 366 | ]
|
363 | 367 | },
|
|
0 commit comments