使用“尝试此 API”在 DialogFlow 中使用 detectorIntent API 进行测试时,始终返回“找不到 DesignTimeAgent”(即使使用预构建的代理模板)。我尝试的 API 是“projects.agent.sessions.detectIntent”。
session 参数为“projects/dialogflow-293106/agent/sessions/123123123”
请求正文是:
{ "queryInput": { "text": { "text": "hi", "languageCode": "en" } } }
返回以下错误:
{ "error": { "code": 404, "message": "com.google.apps.framework.request.NotFoundException: No DesignTimeAgent found for project 'dialogflow-293106'.", "status": "NOT_FOUND" } }
最佳答案
Dialogflow ES 版本出现此错误的原因有多种。一是针对位于美国以外地区的代理商。目前,projects.agent.sessions.detectIntent 的 API Explorer 不支持美国以外的其他区域。由于要向其他区域发出 API 请求,您必须添加 location parameters来定义区域。您可以考虑使用 here 中描述的其他方法来测试 detectorIntent API 方法。 .
如果请求中定义的项目 ID 不正确或没有链接到代理,也可能会发生此错误。要验证代理的项目ID,您可以在agent's general settings中查看此信息。 .
除此之外,目前,Dialogflow CX API 的 API Explorer 不可用。 Dialogflow ES 和 Dialogflow CX 具有不同的 API 方法集。如果您尝试使用 ES 代理的 detectorIntent 方法调用 CX 代理,它也会返回错误消息。如果您想通过 REST API 测试您的 Dialogflow CX 代理,您可以查看此 documentation了解可用 API 方法的概述。
这是detectIntent request适用于 Dialogflow CX 代理。您可以interact with the APIs如所提供的链接中所述。
关于dialogflow-es - 使用预构建的代理模板和 "try this API"按钮使用 detectorIntent API 进行测试时未找到 DesignTimeAgent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64474972/