使用预建代理模板和 "try this API" 按钮使用 detectIntent API 进行测试时未找到 DesignTimeAgent

No DesignTimeAgent found when testing with detectIntent API using prebuilt agent template and "try this API" button

在 DialogFlow 中使用“试试这个 API”使用 detectIntent API 进行测试时,总是 return 找不到 DesignTimeAgent(即使使用预构建的代理模板)。我试过的API是“projects.agent.sessions.detectIntent”。

会话参数为“projects/dialogflow-293106/agent/sessions/123123123”

请求正文是:

{ "queryInput": { "text": { "text": "hi", "languageCode": "en" } } }

出现以下错误returned:

{ "error": { "code": 404, "message": "com.google.apps.framework.request.NotFoundException: No DesignTimeAgent found for project 'dialogflow-293106'.", "status": "NOT_FOUND" } }

screen cap of "Try this API" 1

screen cap of "Try this API" 2

Dialogflow ES 版出现此错误的原因有多种。一种是针对位于美国以外地区的代理商。目前,projects.agent.sessions.detectIntent 的 API Explorer 不支持美国以外的其他地区。由于要为其他地区发出 API 请求,您必须添加 location parameters to define the region. You may consider testing the detectIntent API method using other methods as described here.

如果请求中定义的项目 ID 不正确或没有代理 link,也可能会发生此错误。要验证代理的项目 ID,您可以在 agent's general settings.

中查看此信息

除此之外,目前 API Explorer for Dialogflow CX APIs 不可用。 Dialogflow ES 和 Dialogflow CX 有不同的 API 方法集。如果您尝试使用 ES 代理的 detectIntent 方法调用 CX 代理,它也会 return 一条错误消息。如果您想通过 REST API 测试您的 Dialogflow CX 代理,您可以查看此 documentation 以获得 API 可用方法的概述。

这是 detectIntent request for Dialogflow CX agents. You can interact with the APIs 中描述的 link 提供的。