(content: Any)
| 2521 | |
| 2522 | |
| 2523 | def _flatten_tool_result(content: Any) -> str: |
| 2524 | if isinstance(content, str): |
| 2525 | return content |
| 2526 | if isinstance(content, list): |
| 2527 | parts: list[str] = [] |
| 2528 | for b in content: |
| 2529 | if isinstance(b, dict) and b.get("type") == "text": |
| 2530 | parts.append(str(b.get("text", ""))) |
| 2531 | return " ".join(parts) |
| 2532 | return str(content) if content else "" |
| 2533 | |
| 2534 | |
| 2535 | def _trace_decision_card(trace: "RequestTrace") -> dict[str, Any]: |
no test coverage detected