Jainish1808
Move project files to repository root for Hugging Face Space
bf177ff
Raw
History Blame Contribute Delete
519 Bytes
"""Shared text extraction utilities."""
from typing import Any
def extract_text_from_content(content: Any) -> str:
"""Extract concatenated text from message content (str or list of content blocks)."""
if isinstance(content, str):
return content
if isinstance(content, list):
parts = []
for block in content:
text = getattr(block, "text", "")
if text and isinstance(text, str):
parts.append(text)
return "".join(parts)
return ""