[扩展分享] tencent-ai 腾讯 AI 开放平台 SDK

tencent-ai是 腾讯AI开放平台 SDK


项目地址:https://github.com/justmd5/tencent-ai

欢迎前来 star 以及提 issue !

Requirement

  1. PHP >= 7.0
  2. Composer
  3. ext-curl 拓展
  4. ext-json 拓展

Install

$ composer require justmd5/tencent-ai:dev-master

Usage


$config  = [
    'appKey'    => '1106944xxx',
    'appSecret' => 'dsgnbnWnX8Yxxxxxx',
    'debug'     => 0,//1 show debug info 
];
$AI      = new \Justmd5\TencentAi\Ai($config);

Interface call example

$params = [
'question'=>'腾讯人工智能',
'session'=>123,
];
try {
    dd($AI->nlp->request('textchat', $params));
} catch (\Justmd5\TencentAi\Exception\NotFoundException $e) {
    dd($e);
}

当然laravel版的少不了啦

项目地址:https://github.com/justmd5/laravel-tencent...

Install

in your laravel application, execute the following command:

$ composer require justmd5/laravel-tencent-ai:dev-master

Configure

add service provider to the app.php:

'providers' => [
    // Application Service Providers...
    Justmd5\LaravelTencentAi\ServiceProvider::class,
],

if you use laravel that >= 5.5 ,the above steps are not required.

publish config:

php artisan vendor:publish --provider="Justmd5\LaravelTencentAi\ServiceProvider"

after that, you might want to change some config about tencentai:

// config/tencentai.php
return [
    'appKey'    => '',
    'appSecret' => '',
    'debug'     => 0,
];

Usage

    $params = [
            'question'=>'腾讯人工智能',
            'session'=>123,
    ];

    dd(app('tencent-ai')->nlp->request('textchat', $params));

Documentation

Tencent AI · Official Documents

Help

qq群

【扩展分享】tencent-ai 腾讯 AI 开放平台 SDK

放个公众号【公众号名称:八阿哥】二维码,求扫:

【扩展分享】拼多多 API SDK【拼多多开放平台】

本作品采用《CC 协议》,转载必须注明作者和本文链接
:point_right:github&博客:point_left:
本帖由系统于 5年前 自动加精
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 7

人工智能如此简单 666

5年前 评论

真是膨胀了 我居然在看人工智能

5年前 评论

@罪人 😆,只是站在腾讯的肩膀上而已

5年前 评论

大厂牛逼

5年前 评论

请问这个还能用吗?

2个月前 评论
justmd5 (楼主) 2个月前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!