问题在于创建一个使用 Watson 聊天机器人的应用程序。
好吧,我使用了 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