Extract plain text from message content items.
(content: List[Dict[str, Any]])
| 60 | |
| 61 | |
| 62 | def extract_text_from_content(content: List[Dict[str, Any]]) -> str: |
| 63 | """Extract plain text from message content items.""" |
| 64 | text_parts: List[str] = [] |
| 65 | for item in content or []: |
| 66 | if isinstance(item, dict) and item.get("type") == "text": |
| 67 | text_parts.append(item.get("text", {}).get("value", "")) |
| 68 | return "".join(text_parts) |
| 69 | |
| 70 | |
| 71 | def collect_file_info(directory: str) -> str: |