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

Method describe

entity/messages.py:146–157  ·  view source on GitHub ↗

Human-friendly summary for logging.

(self)

Source from the content-addressed store, hash-verified

144 return cls(type=MessageBlockType.TEXT, text=text)
145
146 def describe(self) -> str:
147 """Human-friendly summary for logging."""
148 if self.type is MessageBlockType.TEXT and self.text:
149 return self.text
150 if self.attachment:
151 name = self.attachment.name or self.attachment.attachment_id
152 return f"[{self.type.value} attachment: {name}]"
153 if self.text:
154 return self.text
155 if "text" in self.data:
156 return str(self.data["text"])
157 return f"[{self.type.value} block]"
158
159 def copy(self) -> "MessageBlock":
160 return MessageBlock(

Callers 2

describeMethod · 0.45
text_contentMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected