MCPcopy
hub / github.com/dataelement/Clawith / ChatMessage

Class ChatMessage

backend/app/models/audit.py:46–64  ·  view source on GitHub ↗

Web chat message between user and agent.

Source from the content-addressed store, hash-verified

44
45
46class ChatMessage(Base):
47 """Web chat message between user and agent."""
48
49 __tablename__ = "chat_messages"
50
51 id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
52 agent_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("agents.id"), nullable=False, index=True)
53 user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=False)
54 role: Mapped[str] = mapped_column(
55 Enum("user", "assistant", "system", "tool_call", name="chat_role_enum"),
56 nullable=False,
57 )
58 content: Mapped[str] = mapped_column(Text, nullable=False)
59 conversation_id: Mapped[str] = mapped_column(String(200), default="web", nullable=False, index=True)
60 # Participant identity (unified User/Agent identity)
61 participant_id: Mapped[uuid.UUID | None] = mapped_column(UUID(as_uuid=True), ForeignKey("participants.id"), nullable=True)
62 # Model thinking process
63 thinking: Mapped[str | None] = mapped_column(Text, nullable=True)
64 created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now(), index=True)
65
66
67class EnterpriseInfo(Base):

Callers 15

_handle_messageMethod · 0.90
_process_wechat_messageFunction · 0.90
save_tool_call_logFunction · 0.90
_send_dingtalk_messageFunction · 0.90
_send_wecom_messageFunction · 0.90
_send_slack_messageFunction · 0.90
_send_platform_messageFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected