PHPackages                             crisen/ai - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. crisen/ai

ActiveLibrarylibrary[Utility &amp; Helpers](/categories/utility)

crisen/ai
=========

优雅的ai客户端

1.0.4(6y ago)265.5k8[2 issues](https://github.com/crisenchou/ai/issues)1MITPHPPHP &gt;=7.0

Since Dec 20Pushed 6y ago2 watchersCompare

[ Source](https://github.com/crisenchou/ai)[ Packagist](https://packagist.org/packages/crisen/ai)[ RSS](/packages/crisen-ai/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (6)Used By (1)

优雅的AI客户端调用
==========

[](#优雅的ai客户端调用)

官方的sdk用起来的感觉实在是太忧伤了,换一种更好的调用方式吧

特点
--

[](#特点)

- 优雅的调用方式
- 仅支持php 7.0以上版本
- 参数兼容原生接口
- 隐藏了开发者不需要关注的细节
- 高度抽象的类
- 符合psr4标准 方便集成到各种项目中

支持的平台
-----

[](#支持的平台)

- 百度AI平台
- 腾讯AI平台

安装
--

[](#安装)

```
composer require  "crisen/ai":"^1.0.0"

```

laravel框架,请点击[这里](https://github.com/crisenchou/laravel-ai)

使用示例
----

[](#使用示例)

```
use Crisen\AI\AI;

...

//百度ai
$baiduConfig = [
     'app_id' => 'your appid',
     'api_key' => 'your api key',
     'secret_key' => 'your secret key'
];
$ai = AI::baidu($baiduConfig);
//腾讯ai
$tencentConfig = [
     'app_id' => 'your appid',
     'app_key' => 'your secret id',
];
$ai = AI::tencent($tencentConfig);

// 图片检索
$url = 'http://aip.bdstatic.com/portal/dist/1543924308745/ai_images/logo.png';
$res = 	$ai->face()->url($url)->detect();
if($res->success()){
    var_dump($res->toArray())
}else{
    var_dump($res->getErrMsg());
}
```

文档
--

[](#文档)

[详细文档](https://doc.crisen.org/ai)

LICENSE
-------

[](#license)

[MIT](LICENSE)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 98.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~41 days

Total

5

Last Release

2537d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b7d5be5d100e7d58fb744b78f8eba03d64c7988d98594491e98766b710a3ec17?d=identicon)[crisenchou](/maintainers/crisenchou)

---

Top Contributors

[![crisenchou](https://avatars.githubusercontent.com/u/16332040?v=4)](https://github.com/crisenchou "crisenchou (53 commits)")[![foundVanting](https://avatars.githubusercontent.com/u/16233666?v=4)](https://github.com/foundVanting "foundVanting (1 commits)")

---

Tags

ai clientbaidu aitencent-ai

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/crisen-ai/health.svg)

```
[![Health](https://phpackages.com/badges/crisen-ai/health.svg)](https://phpackages.com/packages/crisen-ai)
```

###  Alternatives

[qaribou/immutable.php

Immutable, highly-performant collections, well-suited for functional programming and memory-intensive applications.

344146.0k](/packages/qaribou-immutablephp)[formapro/telegram-bot

PHP Telegram Bot

2532.5k](/packages/formapro-telegram-bot)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
