innovination / chatgpt
a simple laravel package to communicate with chatgpt
1.0.1
2024-08-21 11:13 UTC
This package is auto-updated.
Last update: 2026-03-21 14:52:59 UTC
README
This Composer package allows you to chat with OpenAPI's Chatgpt API
Installation
To install this package, you can use Composer. Run the following command in your project directory:
composer require innovination/chatgpt
Usage
To use this package, follow these steps:
- Import the package into your PHP file:
use Innovination\Chatgpt;
- Add GPT keys to your
.envfile
GPT_API_KEY='your-api-key' GPT_MODEL_NAME='your-preferred model (ex. gpt-3.5-turbo-0125)'
- Create an instance of the
Chatgptclass:
$obj = new Chatgpt(); $audio_path = 'link to audio'; $transcription = $obj->audioToText($audio_path);
- Convert audio to text: