Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hanson/tuling-sdk
AI response from tuling123.com.
https://github.com/hanson/tuling-sdk
Last synced: 24 days ago
JSON representation
AI response from tuling123.com.
- Host: GitHub
- URL: https://github.com/hanson/tuling-sdk
- Owner: Hanson
- License: mit
- Created: 2017-06-16T15:32:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-16T15:45:25.000Z (over 7 years ago)
- Last Synced: 2024-03-14T21:28:15.427Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 2.93 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tuling-sdk
图灵 SDK
## 安装
```php
composer require hanson/tuling-sdk
```## 文档
官方文档:http://doc.tuling123.com/openapi2/263611
普通用法:
```php
use Hanson\Tuling\Tuling;$tuling = new Tuling($key, $secret);
$result = $tuling->text('广州天气')->request();
```设置用户ID:
```php
use Hanson\Tuling\Tuling;$tuling = new Tuling($key, $secret);
$result = $tuling->text('广州天气')->user($id)->request();
```设置位置:
```php
use Hanson\Tuling\Tuling;$tuling = new Tuling($key, $secret);
$result = $tuling->text('天气')->location(['city' => '广州'])->user($id)->request();
```默认为输出文字信息,若需要输出图灵原生返回的数组,可把 `->request()` 改为 `->request(true)`