gouda / laravel-chatgpt
Requires
- ext-json: *
Requires (Dev)
- orchestra/testbench: ^7.8
This package is auto-updated.
Last update: 2025-03-12 00:41:02 UTC
README
####Note: This is a version Beta and I wish to complete all my ideas in this package.
sample package for laravel applications to integrate with ChatGPT
Hi, I'm Gouda! 👋
🚀 About Me
I'm a Software Engineer...
Installation
Install with composer
composer require gouda/laravel-chatgpt
Add service Provider in config/app.php
\Gouda\LaravelChatgpt\LaravelChatGptServiceProvider::class,
run migration
php artisan migrate
Environment Variables
To run this package, you will need to add the following environment variables to your .env file
gpt_token
gpt_model
OR run command:
php artisan vendor:publish --tag=chat-gpt-config
How to use ?
Send a new question:
$answer = LaravelGPT::newQuestion('Hello GPT!');
newQuestion function in this case will create dialog automatic in database, but if u want to send question in specific dialog you can use blew function:
Use this function to get all user dialogs:
LaravelGPTDialogs::getUserDialogs(Auth::id());
Use this function to get one dialog
LaravelGPTDialogs::getDialogById($dialog_id);
#Audio
$audio = AudioGPT::newAudio($filePath);
you can pass lang as optional as:
$audio = AudioGPT::newAudio($filePath, 'ar');
Support
For support, email dev.mohamedgouda@gmail.com