qwen-php-client
qwen-php-client copied to clipboard
⚡️ supercharged community-maintained PHP API client that allows you to interact with Alibaba Qwen AI API
qwen PHP Client
Table of Contents
- Overview
- Features
- Installation
- Quick Start Guide
- Basic Usage
- Advanced Usage
- Use With Frameworks
- Testing
- Contributors
- License
Overview
qwen PHP Client is a robust and community-driven PHP client library for seamless integration with the Qwen API.
Key Features
- Easy Integration: Simplifies interaction with the qwen API using a PHP client.
- Method Chaining: Supports fluent method chaining for building requests.
- Customizable: Allows setting different models, query roles, and streaming options.
- PSR-18 Compliance: Utilizes PSR-18 HTTP client for making API requests.
Installation
You can install the package via Composer:
composer require qwen-php/qwen-php-client
Ensure your project meets the following requirements:
- PHP 8.1 or later
Quick Start Guide
Basic Usage
use Qwen\QwenClient;
$apiKey = 'your-api-key';
$response = QwenClient::build($apiKey)
->query('Hello qwen, how are you today?')
->run();
echo 'API Response:'.$response;
Note: in easy mode it will take defaults for all configs Check Default Values
Advanced Usage
use Qwen\QwenClient;
use Qwen\Enums\Queries\QueryRoles;
use Qwen\Enums\Models;
$apiKey = 'your-api-key';
$response = QwenClient::build($apiKey, 'https://dashscope-intl.aliyuncs.com', 500)
->query('System setup query', 'system')
->query('User input message', 'user')
->withModel(Models::QWEN_VL_MAX->value)
->run();
echo 'API Response:'.$response;
Use With Frameworks
Laravel Qwen Package
Testing
tests will come soon .
Changelog
See CHANGELOG for recent changes.
Contributors ✨
Thanks to these wonderful people for contributing to this project! 💖
|
Omar AlAlwi 🏆 Creator |
Want to contribute? Check out the contributing guidelines and submit a pull request! 🚀
Security
If you discover any security-related issues, please email creator : [email protected].
License
The MIT License (MIT). See LICENSE for more information.