MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / _copy_content

Function _copy_content

entity/messages.py:414–425  ·  view source on GitHub ↗
(content: MessageContent)

Source from the content-addressed store, hash-verified

412
413
414def _copy_content(content: MessageContent) -> MessageContent:
415 if content is None:
416 return None
417 if isinstance(content, str):
418 return content
419 copied: List[Any] = []
420 for block in content:
421 if isinstance(block, MessageBlock):
422 copied.append(block.copy())
423 else:
424 copied.append(copy.deepcopy(block))
425 return copied

Callers 1

cloneMethod · 0.85

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected