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

Method clone

entity/messages.py:308–319  ·  view source on GitHub ↗

Deep copy of the message, preserving content blocks.

(self)

Source from the content-addressed store, hash-verified

306 return blocks
307
308 def clone(self) -> "Message":
309 """Deep copy of the message, preserving content blocks."""
310 return Message(
311 role=self.role,
312 content=_copy_content(self.content),
313 name=self.name,
314 tool_call_id=self.tool_call_id,
315 metadata=dict(self.metadata),
316 tool_calls=list(self.tool_calls),
317 keep=self.keep,
318 preserve_role=self.preserve_role,
319 )
320
321 def to_dict(self, include_data: bool = True) -> Dict[str, Any]:
322 """Return a JSON-serializable representation."""

Callers 15

_cloneMethod · 0.80
transformMethod · 0.80
_handle_no_matchMethod · 0.80
_coerce_resultMethod · 0.80
_clone_messagesMethod · 0.80
_build_tool_messageMethod · 0.80
_clone_with_sourceMethod · 0.80
executeMethod · 0.80

Calls 2

MessageClass · 0.85
_copy_contentFunction · 0.85

Tested by

no test coverage detected