附件
附件是TaskWeaver中的一个数据概念,它包含了帖子中除文本消息之外的额外数据。
@dataclass
class Attachment:
"""Attachment is the unified interface for responses attached to the text massage.
Args:
type: the type of the attachment, which can be "thought", "code", "markdown", or "execution_result".
content: the content of the response element.
id: the unique id of the response element.
"""
id: str
type: AttachmentType
content: str
extra: Optional[Any] = None
AttachmentType 是一个枚举类,包含附件类型,可以是"thought"、"code"、"markdown"或"execution_result"。
content 是响应元素的内容,可以是代码片段、markdown文本或执行结果。