gemy / chat-gpt-trans

用于 Chat-GPT 翻译

1.0.0 2024-02-18 08:12 UTC

This package is auto-updated.

Last update: 2024-09-18 09:19:47 UTC


README

Chat GPT Translation

Build Status Total Downloads Latest Stable Version License

Chat GPT 翻译

使用 Chat-gpt 的翻译库

安装

您可以通过 composer 安装此包

composer require gemy/chat-gpt-trans

编辑 env 文件

TRANS_KEY=your_chat_gpt_token

代码

use Gemy\ChatGptTrans\App\ChatGptTrans;

class HomeController extends Controller
{
    public function transText()
    {
         $string = "مساج الحجارة الساخنة والأعشاب";
         /// If you don`t need to save it in a file, write it like this
         $text = new ChatGptTrans('en',false);
         ////
          $text = new ChatGptTrans('en',true);
    }
}

如果响应为 null,则表示存在错误