Download the PHP package mohammadsalamat/chat_ai without Composer

On this page you can find all versions of the php package mohammadsalamat/chat_ai. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package chat_ai

Chat AI Laravel Package

Overview

The Chat AI Laravel Package is an intelligent chatbot integration for Laravel applications. It retrieves responses dynamically from multiple sources, ensuring accuracy and efficiency:

  1. Database – Checks for an existing response.
  2. ChatGPT – If no response is found in the database, it queries OpenAI’s ChatGPT.
  3. Gemini AI – If ChatGPT reaches its limit, it switches to Google Gemini.
  4. Google Search – If no AI-generated response is available, it fetches relevant search results.
  5. Self-Learning – If an answer is not found, it is stored in the database for future queries.

How It Works

The chatbot follows a structured search approach:

  1. Database Lookup

    • The chatbot first searches the database for a response.
    • Admins can manually add a list of questions and answers.
    • If the user's question is at least 70% similar (adjustable via the config file) to a stored question, it retrieves the answer.
  2. ChatGPT Integration

    • If no answer is found in the database, it queries ChatGPT.
    • The response is then stored in the database to reduce API usage and allow admin modifications.
  3. Fallback to Gemini AI

    • If ChatGPT is inactive or has reached its limit, the chatbot switches to Gemini AI and follows the same process.
  4. Google Search
    • If neither ChatGPT nor Gemini AI provides an answer, it fetches relevant data using Google Search.

Provides

Features

Installation

1. Install via Composer

Run the following command to install the package:

2. Publish Configuration (Optional)

This command publishes the migration and view files.

3. Run Migrations

This creates a new database table called questions to store chatbot interactions.

4. Add API Keys to .env

Obtain API keys for OpenAI, Gemini, and Google Search, then update your .env file:

Usage

1. Use in a Controller or Route

Dependency Injection Approach

Instantiating the Controller Manually

2. Create a POST Route to Send a Message

3. Frontend Integration

Send an AJAX request to your Laravel endpoint. A custom view is available at resources/views/chat_ai, including the following AJAX request:

Configuration

The package includes a configuration file located at config/chat_ai.php, where you can customize settings such as:

Contributing

Feel free to submit pull requests or open issues for bug fixes and feature requests.

License

This package is open-source and available under the MIT License.



All versions of chat_ai with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mohammadsalamat/chat_ai contains the following files

Loading the files please wait ....