Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions agent/prompt_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,18 @@ def _strip_yaml_frontmatter(content: str) -> str:
"your response. Images are sent as native photos, and other files arrive as downloadable "
"documents."
),
"google_chat": (
"You are on Google Chat, a workspace-oriented messaging platform. "
"Google Chat uses its own lightweight formatting — NOT standard Markdown. "
"Use *single asterisks* for bold, _underscores_ for italic, "
"~single tilde~ for strikethrough, and `backticks` for code. "
"Double asterisks (**) and headers (# Title) are NOT rendered — "
"they appear as literal characters. "
"For links, use <URL|display text> syntax (NOT [text](url)). "
"Keep messages concise and well-structured with short paragraphs. "
"Messages are capped at 4,096 characters — longer responses are "
"split automatically."
),
}

# ---------------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion cron/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _resolve_cron_enabled_toolsets(job: dict, cfg: dict) -> list[str] | None:
"telegram", "discord", "slack", "whatsapp", "signal",
"matrix", "mattermost", "homeassistant", "dingtalk", "feishu",
"wecom", "wecom_callback", "weixin", "sms", "email", "webhook", "bluebubbles",
"qqbot",
"qqbot", "google_chat",
})

# Platforms that support a configured cron/notification home target, mapped to
Expand All @@ -97,6 +97,7 @@ def _resolve_cron_enabled_toolsets(job: dict, cfg: dict) -> list[str] | None:
"weixin": "WEIXIN_HOME_CHANNEL",
"bluebubbles": "BLUEBUBBLES_HOME_CHANNEL",
"qqbot": "QQBOT_HOME_CHANNEL",
"google_chat": "GOOGLE_CHAT_HOME_CHANNEL",
}

# Legacy env var names kept for back-compat. Each entry is the current
Expand Down Expand Up @@ -337,6 +338,7 @@ def _deliver_result(job: dict, content: str, adapters=None, loop=None) -> Option
"sms": Platform.SMS,
"bluebubbles": Platform.BLUEBUBBLES,
"qqbot": Platform.QQBOT,
"google_chat": Platform.GOOGLE_CHAT,
}

# Optionally wrap the content with a header/footer so the user knows this
Expand Down
22 changes: 22 additions & 0 deletions gateway/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class Platform(Enum):
WEIXIN = "weixin"
BLUEBUBBLES = "bluebubbles"
QQBOT = "qqbot"
GOOGLE_CHAT = "google_chat"


@dataclass
Expand Down Expand Up @@ -1271,6 +1272,27 @@ def _apply_env_overrides(config: GatewayConfig) -> None:
name=os.getenv("QQBOT_HOME_CHANNEL_NAME") or os.getenv(qq_home_name_env, "Home"),
)

# Google Chat (via Cloud Pub/Sub)
google_chat_project = os.getenv("GOOGLE_CHAT_GCP_PROJECT")
if google_chat_project:
if Platform.GOOGLE_CHAT not in config.platforms:
config.platforms[Platform.GOOGLE_CHAT] = PlatformConfig()
config.platforms[Platform.GOOGLE_CHAT].enabled = True
config.platforms[Platform.GOOGLE_CHAT].extra.update({
"gcp_project": google_chat_project,
"pubsub_subscription": os.getenv("GOOGLE_CHAT_PUBSUB_SUBSCRIPTION", "hermes-chat-inbound-sub"),
})
google_chat_credentials = os.getenv("GOOGLE_CHAT_CREDENTIALS", "")
if google_chat_credentials:
config.platforms[Platform.GOOGLE_CHAT].extra["chat_credentials"] = google_chat_credentials
google_chat_home = os.getenv("GOOGLE_CHAT_HOME_CHANNEL")
if google_chat_home and Platform.GOOGLE_CHAT in config.platforms:
config.platforms[Platform.GOOGLE_CHAT].home_channel = HomeChannel(
platform=Platform.GOOGLE_CHAT,
chat_id=google_chat_home,
name=os.getenv("GOOGLE_CHAT_HOME_CHANNEL_NAME", "Home"),
)

# Session settings
idle_minutes = os.getenv("SESSION_IDLE_MINUTES")
if idle_minutes:
Expand Down
Loading