ForcePilot/backend/package/yuxi/channel/extensions/googlechat/accounts.py
Kris c4e301a5e0 feat(googlechat): 新增Google Chat渠道完整实现
新增Google Chat插件的所有核心功能模块,包括账户配置、消息收发、权限控制、媒体处理、会话管理等完整能力
2026-05-21 10:49:33 +08:00

30 lines
771 B
Python

from __future__ import annotations
import logging
logger = logging.getLogger(__name__)
def resolve_merged_config(cfg: dict, account_id: str) -> dict:
gc_config = cfg.get("channels", {}).get("googlechat", {}) if cfg else {}
defaults = gc_config.get("accounts", {}).get("default", {})
account_cfg = gc_config.get("accounts", {}).get(account_id, {})
merged = {**gc_config, **defaults, **account_cfg}
clear_base = {
"serviceAccount",
"serviceAccountFile",
"audienceType",
"audience",
"webhookPath",
"webhookUrl",
"botUser",
"name",
}
for field in clear_base:
if field not in account_cfg and field not in defaults:
merged.pop(field, None)
return merged