问题在于创建使用Watson chatbot的应用程序。
好吧,我使用Vidyasagar Machupalli代码使该应用程序正常工作,但聊天机器人的一部分却没有。这是logcat错误:
(2019-04-28 07:36:02.927 4315-4372/com.example.vmac.chatbot D/OkHttp: <-- 404 Not Found https://gateway-lon.watsonplatform.net/assistant/api/v2/assistants/81d0c0e2-5c74-45c6-9f3b-63bcf1b0b281/sessions?version=2018-11-08 (662ms, 105-byte body)
2019-04-28 07:36:02.966 4315-4372/com.example.vmac.chatbot E/WatsonService: POST https://gateway-lon.watsonplatform.net/assistant/api/v2/assistants/81d0c0e2-5c74-45c6-9f3b-63bcf1b0b281/sessions?version=2018-11-08, status: 404, error: NotFound: No Agent definition found for id: 81d0c0e2-5c74-45c6-9f3b-63bcf1b0b281
2019-04-28 07:36:02.974 4315-4372/com.example.vmac.chatbot W/System.err: com.ibm.watson.developer_cloud.service.exception.NotFoundException: NotFound: No Agent definition found for id: 81d0c0e2-5c74-45c6-9f3b-63bcf1b0b281)
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--Watson Assistant service credentials-->
<!-- REPLACE `ASSISTANT_ID_HERE` with ID of the Assistant to use -->
<string name="assistant_id">####################################</string>
<!-- REPLACE `ASSISTANT_API_KEY_HERE` with Watson Assistant service API Key-->
<string name="assistant_apikey">##################################</string>
<!-- REPLACE `ASSISTANT_URL_HERE` with Watson Assistant service URL-->
<string name="assistant_url">https://gateway-lon.watsonplatform.net/assistant/api</string>
<!--Watson Speech To Text(STT) service credentials-->
<!-- REPLACE `STT_API_KEY_HERE` with Watson Speech to Text service API Key-->
<string name="STT_apikey">#############################</string>
<!-- REPLACE `STT_URL_HERE` with Watson Speech to Text service URL-->
<string name="STT_url">https://gateway-lon.watsonplatform.net/speech-to-text/api</string>
<!--Watson Text To Speech(TTS) service credentials-->
<!-- REPLACE `TTS_API_KEY_HERE` with Watson Text to Speech service API Key-->
<string name="TTS_apikey">############################</string>
<!-- REPLACE `TTS_URL_HERE` with Watson Text to Speech service URL-->
<string name="TTS_url">https://gateway-lon.watsonplatform.net/text-to-speech/api</string>d
答案 0 :(得分:2)
看到错误的原因是您在config.xml中传递了Skill ID
而不是助手ID 。使用您创建的技能创建助手,并在config.xml
link your Skill to an Assistant
也。永远不要在公共论坛上共享您的凭据。