参数: role: 谁说的。可选值: "user" = 用户(你) "assistant" = AI 助手(Claude) "tool" = 工具返回的结果 content: 说了什么(文字内容)
(self, role: str, content: str)
| 33 | """一条对话消息,就像聊天记录里的一条。""" |
| 34 | |
| 35 | def __init__(self, role: str, content: str): |
| 36 | """ |
| 37 | 参数: |
| 38 | role: 谁说的。可选值: |
| 39 | "user" = 用户(你) |
| 40 | "assistant" = AI 助手(Claude) |
| 41 | "tool" = 工具返回的结果 |
| 42 | content: 说了什么(文字内容) |
| 43 | """ |
| 44 | self.role = role |
| 45 | self.content = content |
| 46 | |
| 47 | def __repr__(self): |
| 48 | # 方便打印查看 |
nothing calls this directly
no outgoing calls
no test coverage detected