qwen-php / qwen-php-client
robust and community-driven PHP SDK library for seamless integration with the qwen AI API, offering efficient access to advanced AI and data processing capabilities
Requires
- php: ^8.1.0
- php-http/discovery: ^1.20.0
- php-http/multipart-stream-builder: ^1.4.2
- psr/http-client: ^1.0.3
- psr/http-client-implementation: ^1.0.1
- psr/http-factory-implementation: *
- psr/http-message: ^1.1.0|^2.0.0
Requires (Dev)
- guzzlehttp/guzzle: ^7.9.2
- guzzlehttp/psr7: ^2.7.0
- laravel/pint: ^1.18.1
- mockery/mockery: ^1.6.12
- nunomaduro/collision: ^7.11.0|^8.5.0
- pestphp/pest: ^2.36.0|^3.5.0
- pestphp/pest-plugin-arch: ^2.7|^3.0
- pestphp/pest-plugin-type-coverage: ^2.8.7|^3.1.0
- phpstan/phpstan: ^1.12.7
- roave/security-advisories: dev-latest
- symfony/var-dumper: ^6.4.11|^7.1.5
This package is auto-updated.
Last update: 2025-02-01 21:43:32 UTC
README
qwen PHP Client
Table of Contents
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! 💖
Want to contribute? Check out the contributing guidelines and submit a pull request! 🚀
Security
If you discover any security-related issues, please email creator : omaralwi2010@gmail.com
.
License
The MIT License (MIT). See LICENSE for more information.