定制 masterskill/chat-gpt 二次开发

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

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

masterskill/chat-gpt

Composer 安装命令:

composer require masterskill/chat-gpt

包简介

This is an extension of beautifull package that is 'orhanerday/open-ai'

README 文档

README

composer require masterskill/chat-gpt

Documentation

How to initialize the package

You need to instaciate the OpenAi class

require "vendor/autoload.php";

Use the namespace

use Masterskill\Chatgpt\OpenAi;

Instanctiate class

$openAi = new OpenAi("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");

Ex : get all available models $response = $openAi->models()

How to use it

Models

  • Retrieve all models $openAi->models()
  • Retrieve one model $openAi->getModel($modelName)

Chat

  • Chat with GPT : $openAi->chat($modelName, $data)

-- $modelName : should be one available on the models listed. -- $data : should be on form of : - array of ["role" => $role, "content" => $content] And then, you can implemente it like you want, but just follow what said from the doc

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: GPL-1.0-only
  • 更新时间: 2023-07-07