我正在尝试将isp(购买技能)添加到我的Alexa Skill中。技能代码用python编写,在启动请求处理程序中,我编写了以下代码:
locale = handler_input.request_envelope.request.locale
monetization_service = handler_input.service_client_factory.get_monetization_service()
product_response = monetization_service.get_in_skill_products(locale)
if isinstance(product_response, InSkillProductsResponse):
in_skill_product_list = product_response.in_skill_products
self._logger.info(in_skill_product_list)
尽管运行lambda时出现以下错误:
Attempting to use service client factory with no configured API client
有人遇到这个问题让我知道它在做什么错误吗?
初始化我正在使用的技能组时
sb = SkillBuilder()
此SkillBuilder未配置APIClient。改为将其更改为
sb = StandardSkillBuilder()
因为已配置ApiClient,所以可以工作。