定制 crembelski/iacommunication 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  1. Install the Package
    Run the following command in your project root to install the package:

    composer require crembelski/iacommunication
  2. Add the Service Provider
    In your config/app.php, add the following line to the providers array:

    crembelski\iacommunication\IACommunicationServiceProvider::class,
  3. Publish the Configuration
    Run the following command to publish the configuration file:

    php artisan vendor:publish --tag=config --provider="crembelski\iacommunication\IACommunicationServiceProvider"
  4. Configure Your OpenAI
    Add your OpenAI API Key and the service name in the .env file of your Laravel application. Example:

    IA_API_KEY=your_openai_api_key_here
    IA_SERVICE=OpenAI

    Replace your_openai_api_key_here with 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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-20