jormin/laravel-tuling

v1.0.2 2017-10-15 18:27 UTC

This package is auto-updated.

Last update: 2024-05-05 18:34:38 UTC


README

集成了 图灵 官方的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.