gouda/laravel-chatgpt

There is no license information available for the latest version (v0.1) of this package.

v0.1 2023-06-16 19:10 UTC

This package is auto-updated.

Last update: 2024-05-11 23:02:37 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