简体   繁体   English

Botman 不听 Dialogflow 动作

[英]Botman not listening to Dialogflow action

I am working on a chatbot with Botman.我正在与 Botman 一起开发聊天机器人。 I want to integrate Dialogflow's NLP so I'm calling the middleware and one of it's actions.我想集成 Dialogflow 的 NLP,所以我正在调用中间件及其操作之一。 The problem is that Botman is not hearing it.问题是 Botman 没有听到。 I just keep getting this error:我只是不断收到此错误:

这是我得到的唯一控制台错误

这是我的意图的动作名称

这就是我调用中间件的方式

This is my intent's action name This is the way I'm calling the middleware I'm using my Client access token.这是我的意图的操作名称 这是我调用中间件的方式 我正在使用我的客户端访问令牌。 I tried calling the action different names like 'input.automovil', 'automovil', (.*), but it's still failing and I haven't found enough examples.我尝试将动作称为不同的名称,例如“input.automovil”、“automovil”、(.*),但它仍然失败,而且我还没有找到足够的示例。

The documentation is not updated.文档没有更新。 ApiAi is renamed as Dialogflow ApiAi更名为Dialogflow

Replace代替

use BotMan\\BotMan\\Middleware\\ApiAi; with use BotMan\\BotMan\\Middleware\\Dialogflow;use BotMan\\BotMan\\Middleware\\Dialogflow;

and

$dialogflow = ApiAi::create('your-key')->listenForAction(); with $dialogflow = Dialogflow::create('your-key')->listenForAction();$dialogflow = Dialogflow::create('your-key')->listenForAction();

try changing your lines 27 to 33 the the below尝试将您的第 27 行更改为以下第 33 行

$botman->hears('automovil', function (BotMan $bot) {
    // The incoming message matched the "my_api_action" on Dialogflow
    // Retrieve Dialogflow information:
    $extras = $bot->getMessage()->getExtras();
    $apiReply = $extras['apiReply'];
    $apiAction = $extras['apiAction'];
    $apiIntent = $extras['apiIntent'];

    $bot->reply($apiReply);
})->middleware($dialogflow);

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

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