mehdihamid / ai
这是 ai API
1.0.1
2024-07-23 14:52 UTC
README
这是一个免费的 ai 库,供开发者使用。
要求
Ai API 需要 PHP 8.0+。
安装
在您的 composer.json
文件中将 mehdihamid/ai
添加为 require 依赖项
composer require mehdihamid/ai
使用方法
ChatGPT API
使用 ChatGPT API
use Ai\ChatGPT; $api = new ChatGPT();
发送新消息
echo $api->send("hello");
带有历史记录的发送新消息
$result = $api->send("hello"); $response = json_decode($result); echo $api->send("What was my previous message?", $response->result->history);
如果这个项目对您有帮助,您可能会想给它一个🌟
- TRX :
TZ7zUPVnVTRnatn1JZtRQVAzfFfJ9xmjjQ