Giter Site home page Giter Site logo

justmd5 / tencent-ai Goto Github PK

View Code? Open in Web Editor NEW
68.0 3.0 18.0 80 KB

腾讯AI开放平台 【Tencent AI open platform】

Home Page: https://packagist.org/packages/justmd5/tencent-ai

License: MIT License

PHP 100.00%
tencent-ai tencent ai tencent-ai-sdk ai-sdk sdk qq-ai qq-ai-sdk ai-api

tencent-ai's Introduction

📢 请注意!由于腾讯原有免费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

使用

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

接口调用示例

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

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

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

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

文档

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.