crembelski/iacommunication
最新稳定版本:1.2.0
Composer 安装命令:
composer require crembelski/iacommunication
包简介
This package allows you to communicate with OpenAI via a simple interface.
README 文档
README
This package allows you to communicate with OpenAI via a simple interface.
Installation
-
Install the Package
Run the following command in your project root to install the package:composer require crembelski/iacommunication
-
Add the Service Provider
In yourconfig/app.php, add the following line to theprovidersarray:crembelski\iacommunication\IACommunicationServiceProvider::class,
-
Publish the Configuration
Run the following command to publish the configuration file:php artisan vendor:publish --tag=config --provider="crembelski\iacommunication\IACommunicationServiceProvider" -
Configure Your OpenAI
Add your OpenAI API Key and the service name in the.envfile of your Laravel application. Example:IA_API_KEY=your_openai_api_key_here IA_SERVICE=OpenAI
Replace
your_openai_api_key_herewith your actual API key from OpenAI.
Usage
Once installed and configured, you can use the completions method to send a message to OpenAI.
use crembelski\iacommunication\IACommunication; $iaComm = new IACommunication(); $response = $iaComm->completions("Hello AI!");
License
This package is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-20