@@ -380,69 +380,6 @@ def summarize_messages(
380
380
)
381
381
)
382
382
383
-
384
- def show_agent_logs (
385
- printer : Printer ,
386
- agent_role : str ,
387
- formatted_answer : Optional [Union [AgentAction , AgentFinish ]] = None ,
388
- task_description : Optional [str ] = None ,
389
- verbose : bool = False ,
390
- ) -> None :
391
- """Show agent logs for both start and execution states.
392
-
393
- Args:
394
- printer: Printer instance for output
395
- agent_role: Role of the agent
396
- formatted_answer: Optional AgentAction or AgentFinish for execution logs
397
- task_description: Optional task description for start logs
398
- verbose: Whether to show verbose output
399
- """
400
- if not verbose :
401
- return
402
-
403
- agent_role = agent_role .partition ("\n " )[0 ]
404
-
405
- if formatted_answer is None :
406
- # Start logs
407
- printer .print (
408
- content = f"\033 [1m\033 [95m# Agent:\033 [00m \033 [1m\033 [92m{ agent_role } \033 [00m"
409
- )
410
- if task_description :
411
- printer .print (
412
- content = f"\033 [95m## Task:\033 [00m \033 [92m{ task_description } \033 [00m"
413
- )
414
- else :
415
- # Execution logs
416
- printer .print (
417
- content = f"\n \n \033 [1m\033 [95m# Agent:\033 [00m \033 [1m\033 [92m{ agent_role } \033 [00m"
418
- )
419
-
420
- if isinstance (formatted_answer , AgentAction ):
421
- thought = re .sub (r"\n+" , "\n " , formatted_answer .thought )
422
- formatted_json = json .dumps (
423
- formatted_answer .tool_input ,
424
- indent = 2 ,
425
- ensure_ascii = False ,
426
- )
427
- if thought and thought != "" :
428
- printer .print (
429
- content = f"\033 [95m## Thought:\033 [00m \033 [92m{ thought } \033 [00m"
430
- )
431
- printer .print (
432
- content = f"\033 [95m## Using tool:\033 [00m \033 [92m{ formatted_answer .tool } \033 [00m"
433
- )
434
- printer .print (
435
- content = f"\033 [95m## Tool Input:\033 [00m \033 [92m\n { formatted_json } \033 [00m"
436
- )
437
- printer .print (
438
- content = f"\033 [95m## Tool Output:\033 [00m \033 [92m\n { formatted_answer .result } \033 [00m"
439
- )
440
- elif isinstance (formatted_answer , AgentFinish ):
441
- printer .print (
442
- content = f"\033 [95m## Final Answer:\033 [00m \033 [92m\n { formatted_answer .output } \033 [00m\n \n "
443
- )
444
-
445
-
446
383
def _print_current_organization ():
447
384
settings = Settings ()
448
385
if settings .org_uuid :
0 commit comments