Unified message schema (Pydantic) for in-process use and adapter implementations. Matches the gRPC UnifiedMessage / Platform definitions.
# Source: https://github.com/The-Swarm-Corporation/ClawSwarm | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""
Unified message schema (Pydantic) for in-process use and adapter implementations.
Matches the gRPC UnifiedMessage / Platform definitions.
"""
from __future__ import annotations
from enum import IntEnum
from typing import Any
from claw_swarm.gateway.proto import messaging_gateway_pb2 as pb
from pydantic import BaseModel, Field
class Platform(IntEnum):
UNSPECIFIED = 0
TELEGRAM = 1
DISCORD = 2
WHATSAPP = 3
EMAIL = 4
class UnifiedMessage(BaseModel):
"""Single message normalized from Telegram, Discord, or WhatsApp."""
id: str
platform:
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key