Download the PHP package softcreatr/php-perplexity-ai-sdk without Composer
On this page you can find all versions of the php package softcreatr/php-perplexity-ai-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download softcreatr/php-perplexity-ai-sdk
More information about softcreatr/php-perplexity-ai-sdk
Files in softcreatr/php-perplexity-ai-sdk
Package php-perplexity-ai-sdk
Short Description A powerful and easy-to-use PHP SDK for the pplx API, allowing seamless integration of advanced AI-powered features into your PHP projects.
License ISC
Informations about the package php-perplexity-ai-sdk
PerplexityAI API Wrapper for PHP
This PHP library provides a simple wrapper for the PerplexityAI API, allowing you to easily integrate the PerplexityAI API into your PHP projects.
Features
- Easy integration with PerplexityAI API
- Supports all PerplexityAI API endpoints
- Utilizes PSR-17 and PSR-18 compliant HTTP clients, and factories for making API requests
Requirements
- PHP 7.4 or higher
- A PSR-17 HTTP Factory implementation (e.g., guzzle/psr7 or nyholm/psr7)
- A PSR-18 HTTP Client implementation (e.g., guzzlehttp/guzzle or symfony/http-client)
Installation
You can install the library via Composer:
Usage
First, include the library in your project:
Then, create an instance of the PerplexityAI
class with your API key, organization (optional), an HTTP client, an HTTP request factory, and an HTTP stream factory:
Now you can call any supported PerplexityAI API endpoint using the magic method __call
:
For more details on how to use each endpoint, refer to the PerplexityAI API documentation, and the examples provided in the repository.
Supported Methods
Chat Completions
- Create Chat Completion - Example
createChatCompletion(array $options = [])
Changelog
For a detailed list of changes and updates, please refer to the CHANGELOG.md file. We adhere to Semantic Versioning and document notable changes for each release.
Known Problems and limitations
Streaming Support
Currently, streaming is not supported. It's planned to address this limitation asap. For now, please be aware that these methods cannot be used for streaming purposes.
If you require streaming functionality, consider using an alternative implementation or keep an eye out for future updates to this library.
License
This library is licensed under the ISC License. See the LICENSE file for more information.
Maintainers 🛠️
Sascha Greuel |
Contributors ✨
All versions of php-perplexity-ai-sdk with dependencies
ext-fileinfo Version *
ext-json Version *
ext-mbstring Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.0