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

Class Message

mini_claude_code/models.py:36–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34]
35
36class Message(BaseModel):
37 role: Literal['user', 'assistant', 'tool']
38 content: list[AnyContentBlock] = Field(default_factory=list)
39
40 @classmethod
41 def user_text(cls, input:str) -> "Message":
42 return cls(role='user', content=[TextContentBlock(type='text',text=input)])
43 @classmethod
44 def tool_result(cls, id, name, output, is_error):
45 return cls(role='tool', content = [ToolResultContentBlock(type='tool_result',id=id, name=name,output=output,is_error=is_error)])
46 @classmethod
47 def tool_use(cls, id, name, input):
48 return cls(role='assistant', content=[ToolContentBlock(type='tool_use',id=id, name=name, input=input)])
49
50class Session(BaseModel):
51 messages: list[Message] = Field(default_factory=list)

Callers 2

build_assistant_messageFunction · 0.90
compact_sessionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected