我想知道是否可以使用首选的IDE而不是在提供的嵌入式编辑器中编写您的实现功能?如果是这样,谁能提供步骤/链接来建立IDE与指定代理之间的通信?
P.S。我已经尝试使用Dialogflow API,并且由于我不想将我的代理实施到网站中,所以没有用。
在这里,您可以使用以下步骤连接服务器以实现Dialogflow。
app.js
const app = express();
app.use('/assets', express.static(path.join(__dirname, 'assets')))
app.get("/", (req, res) => res.send("online"));
app.post("/dialogflow", express.json(), (req, res) => {
const agent = new WebhookClient({ request: req, response: res });
let intentMap = new Map();
intentMap.set("Default Welcome Intent", welcome);
intentMap.set("Exit Intent", exit);
});
function exit(agent){}
function welcome(agent){}
[注意:这仅用于本地开发,以后您可以在运行您的实现的位置添加真实的生产服务器URL。