PHPackages                             abdullah-ai/ai-automation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. abdullah-ai/ai-automation

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

abdullah-ai/ai-automation
=========================

A PHP package for AI-driven automation and chat capabilities with OpenAI's GPT models.

21[2 issues](https://github.com/abdullahmamunn/ai-automation/issues)PHP

Since Feb 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/abdullahmamunn/ai-automation)[ Packagist](https://packagist.org/packages/abdullah-ai/ai-automation)[ RSS](/packages/abdullah-ai-ai-automation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

AI Automation
=============

[](#ai-automation)

**AI Automation** is a PHP package that provides a simple interface to interact with OpenAI's GPT models, enabling seamless AI-driven automation and chat capabilities in your PHP projects.

---

Features
--------

[](#features)

- Send prompts to OpenAI's GPT models (e.g., `gpt-3.5-turbo`) and receive responses.
- AI for chatbots.
- Designed for modern PHP applications, with support for `.env` configuration.

---

Installation
------------

[](#installation)

### Step 1: Install the Package

[](#step-1-install-the-package)

Add the package to your Laravel or PHP project using Composer:

```
composer require abdullah-ai/ai-automation:dev-master
```

---

Configuration
-------------

[](#configuration)

### Step 2: Set Up Your API Key

[](#step-2-set-up-your-api-key)

1. Obtain your OpenAI API key from OpenAI API Keys.
2. Add the API key to your Laravel or PHP project’s `.env` file:

```
AI_AUTOMATION_API_KEY=your-openai-api-key
```

---

Usage
-----

[](#usage)

### Example in Laravel

[](#example-in-laravel)

Below is an example of how to use the AI Automation package in a Laravel project:

```
use AbdullahAI\AIAutomation\AIAutomation;

public function getAIResponse() {
    // Fetch the API key from the .env file
    $apiKey = env('AI_AUTOMATION_API_KEY');
    $model = 'gpt-3.5-turbo', // you can Specify the model
    $automation = new AIAutomation($apiKey, $model);

    $prompt = "I have purchased a product but it is of poor quality.";
    // Get AI response
    $response = $automation->chatCompletion($prompt);

    // Return the response as JSON
    return response()->json(['AI Response' => $response]);
}
```

---

Methods
-------

[](#methods)

- `__construct(string $apiKey)`

Initializes the AIAutomation class with your OpenAI API key.

- **Parameter:** `$apiKey` - The OpenAI API key. `chatCompletion(string $message): string`Sends a user prompt to OpenAI's API and retrieves the AI's response.
- **Parameter:** `$message` - The user-provided input for the AI.
- **Returns:** A string containing the AI's response.

---

Requirements
------------

[](#requirements)

- PHP 8.0 or higher
- Composer
- GuzzleHTTP (^7.0)
- Laravel (optional, for framework integration)
- PHPUnit (^10.5 for development and testing)

---

Author
------

[](#author)

### Abdullah Al Mamun

[](#abdullah-al-mamun)

For support or questions: 📧

###  Health Score

10

—

LowBetter than 0% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/312dde99dfc9601a0248423b6f91b1a9462a9ba6bced1b32a7487ddd3823e8e4?d=identicon)[abdullahmamunn](/maintainers/abdullahmamunn)

---

Top Contributors

[![abdullahmamunn](https://avatars.githubusercontent.com/u/26632344?v=4)](https://github.com/abdullahmamunn "abdullahmamunn (5 commits)")

### Embed Badge

![Health badge](/badges/abdullah-ai-ai-automation/health.svg)

```
[![Health](https://phpackages.com/badges/abdullah-ai-ai-automation/health.svg)](https://phpackages.com/packages/abdullah-ai-ai-automation)
```

###  Alternatives

[imliam/shareable-link

Conveniently generate shareable URLs for various social media websites

102.5k](/packages/imliam-shareable-link)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
