Write a formatted tool call to the trace output.
(out: Any, name: str, args: Any, count: int)
| 631 | |
| 632 | |
| 633 | def _write_tool_call(out: Any, name: str, args: Any, count: int) -> None: |
| 634 | """Write a formatted tool call to the trace output.""" |
| 635 | if isinstance(args, dict): |
| 636 | parts = [] |
| 637 | for k, v in args.items(): |
| 638 | sv = str(v) |
| 639 | if len(sv) > 80: |
| 640 | sv = sv[:77] + "..." |
| 641 | parts.append(f"{k}={sv}") |
| 642 | args_str = ", ".join(parts) |
| 643 | else: |
| 644 | args_str = str(args)[:200] |
| 645 | |
| 646 | out.write(f" {_CYAN}[{count}] {_BOLD}{name}{_RESET}{_CYAN}({args_str}){_RESET}\n") |
| 647 | out.flush() |
| 648 | |
| 649 | |
| 650 | def _write_text_block(out: Any, text: str) -> None: |
no test coverage detected