我在我的一个应用程序中使用了API.AI Android SDK,它使用clientAccessToken进行对话流。现在,dialogflow已从v2迁移,clientAccessToken已被弃用。那么现在有没有办法从API中获取clientAccessToken呢?
我使用了下面的代码。
private AIService aiService;
final AIConfiguration config = new AIConfiguration(clientAccessTokenAI,
AIConfiguration.SupportedLanguages.English,
AIConfiguration.RecognitionEngine.System);
aiService = AIService.getService(context, config);
aiService.setListener(this);
aiService.startListening();
有没有其他方法来实现这一点。
发布于 2020-07-21 19:36:14
Dialogflow客户端库和Dialogflow API V1已被弃用,并于2019年10月23日关闭-因此,即使您能够创建一个新的clientAccessToken
,您的实现也不会工作。
要继续使用谷歌应用编程接口的Dialogflow,您可以利用V2的Java Client Library (请参阅quickstart guide for Java)。
缺点是你将不得不重新实现API.AI给你的开箱即用的东西(如果需要)。从好的方面来说,围绕检测意图请求的中心思想,V2应用编程接口更易于交互。
https://stackoverflow.com/questions/63019009
复制