承接 gambry/dialogflow-webhook 相关项目开发

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

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

gambry/dialogflow-webhook

最新稳定版本:2.2.0

Composer 安装命令:

composer require gambry/dialogflow-webhook

包简介

DialogFlow Webhook Fulfillment PHP sdk

README 文档

README

Build Status version Downloads

This is an unofficial php sdk for Dialogflow Fulfillment.

If you are looking for Detect Intent and Agent APIs php sdk have a look a the official repo.

Dialogflow: Build brand-unique, natural language interactions for bots, applications and devices.

Install:

Via composer:

$ composer require gambry/dialogflow-webhook

Usage:

In your webhook request handler:

require_once __DIR__.'/vendor/autoload.php';

if ($webhook_json = json_decode($request_body, TRUE)) {
    $request = new \DialogFlow\Model\Webhook\Request($webhook_json);
    $intent_name = $request->getResult()->getIntent()->getIntentName();
    
    if ($intent_name === 'HelloWorld') {
        $fulfillment = new \DialogFlow\Model\Fulfillment();
        $fulfillment->setText('Hi from the fulfilment!');
        
        $response = new \DialogFlow\Model\Webhook\Response();
        $response->setFulfillment($fulfillment);
        
        echo json_encode($response);
    }
}

Note: depending by the way you handle the request the library auto-loading, the $request_body variable and the way to return the $response may vary.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 60
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固