简体   繁体   English

Dialogflow v2是否有简单的HTTP API?

[英]Is there a simple HTTP API for Dialogflow v2?

I'm learning Dialogflow right now, and I'd like to connect a bot to some frontend web code. 我现在正在学习Dialogflow,我想将漫游器连接到一些前端Web代码。 I know about the Node.js API for Dialogflow, but for my current purposes, it seems a little over-complicated. 我知道用于Dialogflow的Node.js API,但是就我当前的目的而言,它似乎有些复杂。 The only functionality I need right now is sending user input to the bot and receiving the bot's response, so it seems like setting up an entire server just to communicate with the bot is pretty excessive. 我现在唯一需要的功能是将用户输入发送到机器人并接收机器人的响应,因此设置整个服务器以与机器人进行通信似乎过于繁琐。

Is there a way to communicate with the bot from the frontend directly, like an HTTP API? 有没有办法像HTTP API这样从前端直接与漫游器通信? Or is the NPM package the only option? 还是NPM软件包是唯一的选择?

This is the only endpoint that you need: https://cloud.google.com/dialogflow-enterprise/docs/reference/rest/v2/projects.agent.sessions/detectIntent . 这是唯一需要的端点: https : //cloud.google.com/dialogflow-enterprise/docs/reference/rest/v2/projects.agent.sessions/detectIntent As long as you get the authentication right you should be good to go. 只要您获得正确的身份验证,就应该可以进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM