MCPcopy Create free account
hub / github.com/Louisym/MiniCC / __init__

Method __init__

tutorials/01_agentic_loop_basics.py:35–45  ·  view source on GitHub ↗

参数: role: 谁说的。可选值: "user" = 用户(你) "assistant" = AI 助手(Claude) "tool" = 工具返回的结果 content: 说了什么(文字内容)

(self, role: str, content: str)

Source from the content-addressed store, hash-verified

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 # 方便打印查看

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected