我正在尝试将 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 后即可工作。
关于python - 尝试在未配置 API 客户端的情况下使用服务客户端工厂,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59584387/