Looking to hire Laravel developers? Try LaraJobs

laravel-tuling maintained by jormin

Description
图灵APi集成
Author
Last update
2017/10/16 03:51 (dev-master)
License
Downloads
41
Tags

Comments
comments powered by Disqus

集成了 图灵 官方的Api接口。

安装

  1. 安装包文件

    $ composer require jormin/laravel-tuling
    

配置

  1. 注册 ServiceProvider:

    Jormin\TuLing\TuLingServiceProvider::class,
    
  2. 创建配置文件:

    php artisan vendor:publish
    

    执行命令后会在 config 目录下生成本扩展配置文件:laravel-tuling.php

  3. .env 文件中增加如下配置:

    • TULING_API_KEY:图灵ApiKey。

使用

  1. 获取自动回复信息

       $message = '西安天气';
       $userID = '用户ID';
       $location = '陕西省西安市雁塔区';
       Jormin\TuLing\TuLing::chat($message, $userID, $location);
    

    消息字段详细见 图灵官方文档.

License

The MIT License (MIT). Please see License File for more information.