(messages: list[dict[str, Any]])
| 662 | |
| 663 | |
| 664 | def _messages_to_transcript(messages: list[dict[str, Any]]) -> str: |
| 665 | parts: list[str] = [] |
| 666 | for msg in messages: |
| 667 | if not isinstance(msg, dict): |
| 668 | continue |
| 669 | role = str(msg.get("role", "unknown")).upper() |
| 670 | text = _content_to_text(msg.get("content")) |
| 671 | if not text: |
| 672 | continue |
| 673 | parts.append(f"[{role}]\n{text}") |
| 674 | return "\n\n".join(parts) |
| 675 | |
| 676 | |
| 677 | def _split_leading_system(messages: list[dict[str, Any]]) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]: |
no test coverage detected