(messages: list[dict[str, Any]])
| 548 | |
| 549 | |
| 550 | def _has_recent_tool_activity(messages: list[dict[str, Any]]) -> bool: |
| 551 | for msg in messages: |
| 552 | if not isinstance(msg, dict): |
| 553 | continue |
| 554 | if msg.get("role") == "tool": |
| 555 | return True |
| 556 | if msg.get("tool_calls"): |
| 557 | return True |
| 558 | return False |
| 559 | |
| 560 | |
| 561 | def _content_to_text(content: Any) -> str | None: |
no test coverage detected