MCPcopy
hub / github.com/OpenBMB/ChatDev / text_content

Method text_content

entity/messages.py:275–287  ·  view source on GitHub ↗

Best-effort string representation of the content.

(self)

Source from the content-addressed store, hash-verified

273 )
274
275 def text_content(self) -> str:
276 """Best-effort string representation of the content."""
277 if self.content is None:
278 return ""
279 if isinstance(self.content, str):
280 return self.content
281 # Some providers (e.g., multimodal) return list content; join textual parts.
282 parts = []
283 for block in self.blocks():
284 description = block.describe()
285 if description:
286 parts.append(description)
287 return "\n".join(parts)
288
289 def blocks(self) -> List[MessageBlock]:
290 """Return content as a list of MessageBlock items."""

Callers 15

run_workflow_syncFunction · 0.80
workerFunction · 0.80
_payload_to_textMethod · 0.80
_textMethod · 0.80
transformMethod · 0.80
splitMethod · 0.80
splitMethod · 0.80
_inputs_to_textMethod · 0.80
_invoke_providerMethod · 0.80
_record_model_callMethod · 0.80

Calls 2

blocksMethod · 0.95
describeMethod · 0.45

Tested by

no test coverage detected