ForcePilot/backend/package/yuxi/channel/extensions/alexa/status.py
Kris 37493b6da6 feat(alexa): 新增Amazon Alexa渠道插件完整实现
新增了Alexa渠道的所有核心功能模块,包括配置管理、请求校验、会话管理、安全验证、去重、响应格式化、渐进式响应、主动推送、提醒功能、配对绑定以及Webhook端点,并完成了插件注册和配置项定义。
2026-05-21 10:38:31 +08:00

32 lines
946 B
Python

import logging
from yuxi.channel.protocols import ChannelAccountSnapshot
logger = logging.getLogger(__name__)
class AlexaStatus:
def __init__(self, account=None):
self._account = account
async def probe(self, account: dict | None = None) -> bool:
configured = (
self._account
and self._account.application_id
)
return configured
def build_summary(self, snapshot: object) -> dict:
return {
"channel": "alexa",
"mode": "request_response",
"output_format": "ssml",
"streaming": False,
}
def build_account_snapshot(self, account, config, runtime=None, probe_result=None, audit=None) -> ChannelAccountSnapshot:
return ChannelAccountSnapshot(
account_id=getattr(account, "account_id", "default"),
configured=bool(probe_result) if probe_result is not None else False,
)