承接 genkovich/dialog-flow-bot-man-middleware 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

genkovich/dialog-flow-bot-man-middleware

最新稳定版本:0.0.6

Composer 安装命令:

composer require genkovich/dialog-flow-bot-man-middleware

包简介

Middleware for BotMan (BotMan Studio). Integration with DialogFlow API v2.

README 文档

README

BotMan Middleware to connect DialogFlow with BotMan

Latest Version on Packagist Packagist

Thank's to @eclips16. The code source was taken from pull request.

Installation

Composer

composer require genkovich/dialog-flow-bot-man-middleware

Usage

.env

GOOGLE_CLOUD_PROJECT=project-id
GOOGLE_APPLICATION_CREDENTIALS=/path/to/security-file.json

Where can I get this variables?

  • Login at https://dialogflow.cloud.google.com/
  • Create NewAgent (or use an existing one)
  • Click on "Settings" icon (1)
  • Copy your project id (2) into .env file
  • Click on project id (2)

Step one

  • After that you will find "Service accounts" section (click (1) or (2))

Step

  • Click on "Create service account", fill "name" field and click "Create"

Step

  • On the next step you have to add two roles, "DialogFlow API Admin" and "DialogFlow API Client" and click "Done"

Step

  • Now, go to the page "Manage keys"

Step

  • Create new key in .json format

Step

  • Move downloaded file into project root directory
  • Add path to file in .env

Code example

$dialogflow = \BotMan\Middleware\DialogFlow\V2\DialogFlow::create('en');
$botman->middleware->received($dialogflow);
$botman->hears('smalltalk.(.*)', function ($bot) {
    $extras = $bot->getMessage()->getExtras();
    $bot->reply($extras['apiReply']);
})->middleware($dialogflow);

smalltalk.(.*) - there is action name pattern Step

If you create actions with different prefixes, you can use ->ignoreIntentPattern()

$dialogflow = DialogFlow::create('en')->ignoreIntentPattern();

Security Vulnerabilities

If you discover a security vulnerability within BotMan, please send an e-mail to Marcel Pociot at m.pociot@gmail.com. All security vulnerabilities will be promptly addressed.

License

BotMan is free software distributed under the terms of the MIT license.

统计信息

  • 总下载量: 2.23k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 12
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 12
  • Watchers: 3
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-26