|
185 | 185 | "from llm_agents_from_scratch.logger import enable_console_logging\n",
|
186 | 186 | "\n",
|
187 | 187 | "if LOGGING_ENABLED:\n",
|
188 |
| - " enable_console_logging(logging.INFO)" |
| 188 | + " enable_console_logging(logging.DEBUG)" |
189 | 189 | ]
|
190 | 190 | },
|
191 | 191 | {
|
|
213 | 213 | {
|
214 | 214 | "cell_type": "code",
|
215 | 215 | "execution_count": 13,
|
| 216 | + "id": "980b29c6-bf26-439c-9458-0cab040e854b", |
| 217 | + "metadata": {}, |
| 218 | + "outputs": [ |
| 219 | + { |
| 220 | + "data": { |
| 221 | + "text/plain": [ |
| 222 | + "Task(id_='25aa12c3-ae1a-415c-a186-102b4412c268', instruction='Add one to fifty-five point three. Use an appropriate tool!')" |
| 223 | + ] |
| 224 | + }, |
| 225 | + "execution_count": 13, |
| 226 | + "metadata": {}, |
| 227 | + "output_type": "execute_result" |
| 228 | + } |
| 229 | + ], |
| 230 | + "source": [ |
| 231 | + "task" |
| 232 | + ] |
| 233 | + }, |
| 234 | + { |
| 235 | + "cell_type": "code", |
| 236 | + "execution_count": 14, |
216 | 237 | "id": "e99cca54-0d21-4c9d-9a17-bf595d110fe5",
|
217 | 238 | "metadata": {},
|
218 | 239 | "outputs": [
|
|
222 | 243 | "text": [
|
223 | 244 | "INFO (llm_agents_fs.LLMAgent) : 🚀 Starting task: Add one to fifty-five point three. Use an appropriate tool!\n",
|
224 | 245 | "INFO (llm_agents_fs.TaskHandler) : ⚙️ Processing Step: Add one to fifty-five point three. Use an appropriate tool!\n",
|
| 246 | + "DEBUG (llm_agents_fs.TaskHandler) : 🧵 Rollout: \n", |
| 247 | + "DEBUG (llm_agents_fs.TaskHandler) : 💬 SYSTEM: You are a helpful assistant.\n", |
| 248 | + "DEBUG (llm_agents_fs.TaskHandler) : 💬 USER INPUT: Add one to fifty-five point three. Use an appropriate tool!\n", |
| 249 | + "DEBUG (llm_agents_fs.TaskHandler) : 💬 ASSISTANT: \n", |
225 | 250 | "INFO (llm_agents_fs.TaskHandler) : 🛠️ Executing Tool Call: add_one\n",
|
226 | 251 | "INFO (llm_agents_fs.TaskHandler) : ✅ Successful Tool Call: 56.3\n",
|
227 |
| - "INFO (llm_agents_fs.TaskHandler) : ✅ Step Result: Adding one to fifty-five point three gives us fifty-six point three.\n", |
| 252 | + "INFO (llm_agents_fs.TaskHandler) : ✅ Step Result: The result of adding one to 55.3 is 56.3.\n", |
| 253 | + "DEBUG (llm_agents_fs.TaskHandler) : 🧵 Rollout: assistant: The current instruction is 'Add one to fifty-five point three. Use an appropriate tool!'\n", |
| 254 | + "assistant: I need to make a tool call(s) to `add_one`.\n", |
| 255 | + "tool: {\n", |
| 256 | + " \"tool_call\": {\n", |
| 257 | + " \"tool_name\": \"add_one\",\n", |
| 258 | + " \"arguments\": {\n", |
| 259 | + " \"x\": \"55.3\"\n", |
| 260 | + " }\n", |
| 261 | + " },\n", |
| 262 | + " \"content\": \"56.3\",\n", |
| 263 | + " \"error\": false\n", |
| 264 | + "}\n", |
| 265 | + "assistant: The result of adding one to 55.3 is 56.3.\n", |
| 266 | + "DEBUG (llm_agents_fs.TaskHandler) : ---NEXT STEP PROMPT: You are overseeing an assistant's\n", |
| 267 | + "progress in accomplishing a user instruction. Provided below is the assistant's\n", |
| 268 | + "current response to the original task instruction. Also provided, is an\n", |
| 269 | + "internal 'thinking' process of the assistant that the user has not seen.\n", |
| 270 | + "\n", |
| 271 | + "Determine if the current the response is sufficient to answer the original task\n", |
| 272 | + "instruction. In the case that it is not, provide a new instruction to the\n", |
| 273 | + "assistant in order to help them improve upon their current response.\n", |
| 274 | + "\n", |
| 275 | + "<user-instruction>\n", |
| 276 | + "Add one to fifty-five point three. Use an appropriate tool!\n", |
| 277 | + "</user-instruction>\n", |
| 278 | + "\n", |
| 279 | + "<current-response>\n", |
| 280 | + "The result of adding one to 55.3 is 56.3.\n", |
| 281 | + "</current-response>\n", |
| 282 | + "\n", |
| 283 | + "<thinking-process>\n", |
| 284 | + "assistant: The current instruction is 'Add one to fifty-five point three. Use an appropriate tool!'\n", |
| 285 | + "assistant: I need to make a tool call(s) to `add_one`.\n", |
| 286 | + "tool: {\n", |
| 287 | + " \"tool_call\": {\n", |
| 288 | + " \"tool_name\": \"add_one\",\n", |
| 289 | + " \"arguments\": {\n", |
| 290 | + " \"x\": \"55.3\"\n", |
| 291 | + " }\n", |
| 292 | + " },\n", |
| 293 | + " \"content\": \"56.3\",\n", |
| 294 | + " \"error\": false\n", |
| 295 | + "}\n", |
| 296 | + "assistant: The result of adding one to 55.3 is 56.3.\n", |
| 297 | + "</thinking-process>\n", |
| 298 | + "\n", |
| 299 | + "DEBUG (llm_agents_fs.TaskHandler) : ---NEXT STEP: {\"task_step\":{\"id_\":\"915cca85-0b6b-477d-921e-0dce7b8b3533\",\"task_id\":\"add-one-to-55-point-three\",\"instruction\":\"Add one to fifty-five point three using the tool add_one.\"},\"task_result\":{\"task_id\":\"add-one-to-55-point-three\",\"content\":\"The result of adding one to 55.3 is 56.3.\"}}\n", |
228 | 300 | "INFO (llm_agents_fs.TaskHandler) : No new step required.\n",
|
229 |
| - "INFO (llm_agents_fs.LLMAgent) : 🏁 Task completed: Adding one to fifty-five point three gives us fifty-six point three.\n" |
| 301 | + "INFO (llm_agents_fs.LLMAgent) : 🏁 Task completed: The result of adding one to 55.3 is 56.3.\n" |
230 | 302 | ]
|
231 | 303 | }
|
232 | 304 | ],
|
|
236 | 308 | },
|
237 | 309 | {
|
238 | 310 | "cell_type": "code",
|
239 |
| - "execution_count": 14, |
| 311 | + "execution_count": 15, |
| 312 | + "id": "3615a1c9-8a1d-4783-a840-e186206d9446", |
| 313 | + "metadata": {}, |
| 314 | + "outputs": [ |
| 315 | + { |
| 316 | + "data": { |
| 317 | + "text/plain": [ |
| 318 | + "TaskResult(task_id='25aa12c3-ae1a-415c-a186-102b4412c268', content='The result of adding one to 55.3 is 56.3.')" |
| 319 | + ] |
| 320 | + }, |
| 321 | + "execution_count": 15, |
| 322 | + "metadata": {}, |
| 323 | + "output_type": "execute_result" |
| 324 | + } |
| 325 | + ], |
| 326 | + "source": [ |
| 327 | + "result.task_result" |
| 328 | + ] |
| 329 | + }, |
| 330 | + { |
| 331 | + "cell_type": "code", |
| 332 | + "execution_count": 16, |
240 | 333 | "id": "0fde7c61-f0d9-4ef9-b0b6-90386667bbb8",
|
241 | 334 | "metadata": {},
|
242 | 335 | "outputs": [
|
243 | 336 | {
|
244 | 337 | "name": "stdout",
|
245 | 338 | "output_type": "stream",
|
246 | 339 | "text": [
|
247 |
| - "The result is fifty-six point three.\n" |
| 340 | + "The result of adding one to 55.3 is 56.3.\n" |
248 | 341 | ]
|
249 | 342 | }
|
250 | 343 | ],
|
|
254 | 347 | },
|
255 | 348 | {
|
256 | 349 | "cell_type": "code",
|
257 |
| - "execution_count": 15, |
| 350 | + "execution_count": 17, |
258 | 351 | "id": "93b1cfa1-1ac0-420d-b36e-007de5cdfc7f",
|
259 | 352 | "metadata": {},
|
260 | 353 | "outputs": [
|
261 | 354 | {
|
262 | 355 | "name": "stdout",
|
263 | 356 | "output_type": "stream",
|
264 | 357 | "text": [
|
265 |
| - "assistant: Add one to fifty-five point three. Use an appropriate tool!\n", |
266 |
| - "assistant: I need to make a tool call(s) to add_one\n", |
| 358 | + "assistant: The current instruction is 'Add one to fifty-five point three. Use an appropriate tool!'\n", |
| 359 | + "assistant: I need to make a tool call(s) to `add_one`.\n", |
267 | 360 | "tool: {\n",
|
268 | 361 | " \"tool_call\": {\n",
|
269 | 362 | " \"tool_name\": \"add_one\",\n",
|
|
274 | 367 | " \"content\": \"56.3\",\n",
|
275 | 368 | " \"error\": false\n",
|
276 | 369 | "}\n",
|
277 |
| - "assistant: Adding one to fifty-five point three gives us fifty-six point three.\n" |
| 370 | + "assistant: The result of adding one to 55.3 is 56.3.\n" |
278 | 371 | ]
|
279 | 372 | }
|
280 | 373 | ],
|
281 | 374 | "source": [
|
282 | 375 | "print(result.rollout)"
|
283 | 376 | ]
|
284 |
| - }, |
285 |
| - { |
286 |
| - "cell_type": "code", |
287 |
| - "execution_count": null, |
288 |
| - "id": "e1a01698-dcdc-4796-a41b-6029eafa9ab5", |
289 |
| - "metadata": {}, |
290 |
| - "outputs": [], |
291 |
| - "source": [] |
292 | 377 | }
|
293 | 378 | ],
|
294 | 379 | "metadata": {
|
|
0 commit comments