MCPcopy
hub / github.com/ruc-datalab/DeepAnalyze / extract_text_from_content

Function extract_text_from_content

example/4c_competition/utils.py:62–68  ·  view source on GitHub ↗

Extract plain text from message content items.

(content: List[Dict[str, Any]])

Source from the content-addressed store, hash-verified

60
61
62def 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
71def collect_file_info(directory: str) -> str:

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected