项目作者: justmd5

项目描述 :
腾讯AI开放平台 【Tencent AI open platform】
高级语言: PHP
项目地址: git://github.com/justmd5/tencent-ai.git
创建时间: 2018-06-24T08:53:36Z
项目社区:https://github.com/justmd5/tencent-ai

开源协议:MIT License

下载


📢 请注意!由于腾讯原有免费API已关闭,该项目目前已属于不可用状态

腾讯AI开放平台 SDK

Tencent AI open platform sdk


styleci
PHP from Packagist
GitHub stars
Latest Stable Version
Latest Unstable Version

License



Special thanks to the generous sponsorship by:









Requirement

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

安装

composer require justmd5/tencent-ai

使用

  1. $config = [
  2. 'appKey' => '1106944xxx',
  3. 'appSecret' => 'dsgnbnWnX8Yxxxxxx',
  4. 'debug' => true,//true show debug info
  5. ];
  6. $AI = new \Justmd5\TencentAi\Ai($config);

接口调用示例

智能闲聊 url: https://api.ai.qq.com/fcgi-bin/nlp/nlp_textchat
请求示例1:

  1. $params = [
  2. 'question'=>'腾讯人工智能',
  3. 'session'=>123,
  4. ];
  5. try {
  6. dd($AI->nlp->request('textchat', $params));
  7. } catch (\Justmd5\TencentAi\Exception\NotFoundException $e) {
  8. dd($e);
  9. }

看图说话 url: https://api.ai.qq.com/fcgi-bin/vision/vision_imgtotext
请求示例2:

  1. $params = [
  2. //image 支持两种传递参数方式
  3. // 'image' => base64_encode(file_get_contents(__DIR__ . '/1571126902_843200.jpg')),//old
  4. 'image' => __DIR__ . '/1571126902_843200.jpg',//new
  5. 'session_id' => time(),
  6. ];
  7. try {
  8. var_dump($AI->vision->request('imgtotext', $params));
  9. } catch (\Justmd5\TencentAi\Exception\NotFoundException $e) {
  10. print_r($e->getMessage());
  11. } catch (\Justmd5\TencentAi\Exception\IllegalParameterException $e) {
  12. print_r($e->getMessage());
  13. }

文档

Tencent AI · Official Documents

帮助

qq群



Todo

  • parameter verify

Stargazers over time

Stargazers over time

感谢

SDK 联系人 QQ 语言 实现接口 源代码&SDK 地址
783021975 JAVA ALL https://gitee.com/xshuai/taip
1361653339 Golang ALL https://github.com/shiguanghuxian/txai
1280827369 NodeJS
非全部接口实现
https://github.com/w89612b/qqai-api-sdk
1109527533 Python
非全部接口实现(完善中)
https://gitee.com/french-home/TencentAISDK
1928881525 .NET(C#)
OCR接口实现人脸模块接口实现
https://gitee.com/ch_1928881525/Tentcent.Ai
910139966 PHP ALL https://github.com/justmd5/tencent-ai

License

MIT

FOSSA Status