如何修复未找到 ID Watson Assistant 错误的代理定义?
How can I fix No Agent definition found for id Watson Assistant error?
问题是关于创建一个使用 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
您看到错误的原因是您在 config.xml 中传递 Skill ID
而不是 助理 ID。使用您创建的技能创建助手并在 config.xml
中传递 助手 ID
以下是您可以 link your Skill to an Assistant
Also. never share your credentials in public forums.
已更新:您可以在此处找到您的 Assistant ID,方法是点击设置,如下图所示,然后点击 API Details
问题是关于创建一个使用 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
您看到错误的原因是您在 config.xml 中传递 Skill ID
而不是 助理 ID。使用您创建的技能创建助手并在 config.xml
以下是您可以 link your Skill to an Assistant
Also. never share your credentials in public forums.
已更新:您可以在此处找到您的 Assistant ID,方法是点击设置,如下图所示,然后点击 API Details