ForcePilot/backend/package/yuxi/channels/adapters/wechat/channel_capacity.py

37 lines
949 B
Python
Raw Normal View History

from __future__ import annotations
from typing import Any
class WeChatCapacityProvider:
DAILY_LIMITS: dict[str, dict[str, int]] = {
"mp": {
"dm_msg": 500,
"media_upload": 500,
"api_calls": 200000,
},
"wecom": {
"dm_msg": 1000,
"group_msg": 2000,
"media_upload": 500,
"api_calls": 200000,
},
"personal": {
"dm_msg": 999999,
"group_msg": 999999,
"media_upload": 999999,
"api_calls": 999999,
},
}
@classmethod
def get_capacity_info(cls, mode: str) -> dict[str, Any]:
limits = cls.DAILY_LIMITS.get(mode, {})
return {
"mode": mode,
"daily_limits": dict(limits),
"has_group_support": mode in ("wecom", "personal"),
"has_media_support": True,
"has_reply_support": True,
}