laravel-tuling maintained by jormin
集成了 图灵 官方的Api接口。
安装
-
安装包文件
$ composer require jormin/laravel-tuling
配置
-
注册 ServiceProvider:
Jormin\TuLing\TuLingServiceProvider::class, -
创建配置文件:
php artisan vendor:publish执行命令后会在
config目录下生成本扩展配置文件:laravel-tuling.php。 -
在
.env文件中增加如下配置:TULING_API_KEY:图灵ApiKey。
使用
-
获取自动回复信息
$message = '西安天气'; $userID = '用户ID'; $location = '陕西省西安市雁塔区'; Jormin\TuLing\TuLing::chat($message, $userID, $location);消息字段详细见 图灵官方文档.
License
The MIT License (MIT). Please see License File for more information.