Download the PHP package rajanvijayan/ai-engine without Composer

On this page you can find all versions of the php package rajanvijayan/ai-engine. 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 ai-engine

AI Engine - Multi-Provider PHP Library

A powerful, flexible PHP library for integrating multiple AI providers into your applications. Supports Google Gemini, Meta Llama, and Groq with conversation history.

๐Ÿš€ Features

๐Ÿ“‹ Requirements

๐Ÿ› ๏ธ Installation

๐Ÿ”‘ API Keys Setup

Create a test.ai-key file in your project root:

Get Your API Keys

Provider URL Notes
Gemini makersuite.google.com Google AI
Meta Llama llama.meta.com Official Meta API
Groq console.groq.com FREE tier available!

๐Ÿš€ Quick Start

Basic Usage

Choose Provider

Conversation Mode

๐Ÿ“š API Reference

Constructor

Config Options:

Methods

Method Description
generateContent($prompt) Single prompt, no history
chat($message) Send message with conversation history
newConversation() Clear conversation history
getHistory() Get conversation history array
setSystemInstruction($text) Set AI personality/behavior
switchProvider($name, $apiKey) Switch to different provider
getProviderName() Get current provider name

Static Methods

Method Description
AIEngine::create($provider, $apiKey) Factory method
AIEngine::getModelsForProvider($provider) List available models
AIEngine::getDefaultModels() Get default model per provider

๐Ÿค– Available Models

Gemini

Meta Llama

Groq

๐Ÿ’ฌ Usage Examples

Simple Question

Conversation with Memory

Switch Providers Mid-Session

Error Handling

๐Ÿงช Testing

Interactive Test

This launches an interactive chat where you can:

๐Ÿ“ Project Structure

๐Ÿ”ง Adding New Providers

  1. Create a new class implementing ProviderInterface
  2. Implement required methods: generateContent(), sendMessage(), startNewConversation(), getConversationHistory(), setSystemInstruction(), isConfigured(), getName()
  3. Add the provider to AIEngine::createProvider()

๐Ÿ›ก๏ธ Error Handling

Common errors returned:

Error Cause
Provider not properly configured Invalid or missing API key
Invalid prompt Empty or too long prompt
Error contacting API Network or API issue

๐Ÿ“„ License

MIT License - see LICENSE file.

๐Ÿ™ Acknowledgments


Made with โค๏ธ for the PHP community


All versions of ai-engine with dependencies

PHP Build Version
Package Version
Requires php Version >=8.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 rajanvijayan/ai-engine contains the following files

Loading the files please wait ...