Download the PHP package utopia-php/agents without Composer
On this page you can find all versions of the php package utopia-php/agents. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download utopia-php/agents
More information about utopia-php/agents
Files in utopia-php/agents
Informations about the package agents
Utopia Agents
Utopia Agents is a simple and lite library for building and managing AI agents in PHP applications. This library provides a collection of tools and utilities for creating, managing, and orchestrating AI agents with support for multiple AI providers. This library is maintained by the Appwrite team.
Although this library is part of the Utopia Framework project it is dependency free and can be used as standalone with any other PHP project or framework.
Getting Started
Install using composer:
System Requirements
Utopia Framework requires PHP 8.0 or later. We recommend using the latest PHP version whenever possible.
Features
- Multiple AI Providers - Support for OpenAI, Anthropic, Deepseek, Perplexity, and XAI APIs
- Flexible Message Types - Support for text and structured content in messages
- Conversation Management - Easy-to-use conversation handling between agents and users
- Model Selection - Choose from various AI models (GPT-4, Claude 3, Deepseek Chat, Sonar, Grok, etc.)
- Parameter Control - Fine-tune model behavior with temperature and token controls
Usage
Basic Example
Using Different AI Providers
OpenAI
Available OpenAI Models:
MODEL_GPT_4_TURBO
: Latest GPT-4 TurboMODEL_GPT_4
: Standard GPT-4MODEL_GPT_3_5_TURBO
: Fast GPT-3.5 Turbo
Anthropic
Available Anthropic Models:
MODEL_CLAUDE_3_OPUS
: Most powerful modelMODEL_CLAUDE_3_SONNET
: Balanced performanceMODEL_CLAUDE_3_HAIKU
: Fast and efficientMODEL_CLAUDE_2_1
: Previous generation
Deepseek
Available Deepseek Models:
MODEL_DEEPSEEK_CHAT
: General-purpose chat modelMODEL_DEEPSEEK_CODER
: Specialized for code-related tasks
Perplexity
Available Perplexity Models:
MODEL_SONAR
: General-purpose search modelMODEL_SONAR_PRO
: Enhanced search modelMODEL_SONAR_DEEP_RESEARCH
: Advanced search modelMODEL_SONAR_REASONING
: Reasoning modelMODEL_SONAR_REASONING_PRO
: Enhanced reasoning model
XAI
Available XAI Models:
MODEL_GROK_2_LATEST
: Latest Grok modelMODEL_GROK_2_IMAGE
: Latest Grok model with image support
Managing Conversations
Working with Messages
Tests
To run all unit tests, use the following Docker command:
To run static code analysis, use the following Psalm command:
Security
We take security seriously. If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Contributing
All code contributions - including those of people having commit access - must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code.
We truly ❤️ pull requests! If you wish to help, you can learn more about how you can contribute to this project in the contribution guide.
Copyright and license
The MIT License (MIT) http://www.opensource.org/licenses/mit-license.php