(content: MessageContent)
| 412 | |
| 413 | |
| 414 | def _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 |