qwen / qwen-php-client
Community-Driven PHP SDK for Qwen AI API Integration.
Installs: 1 800
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
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
This package is auto-updated.
Last update: 2025-05-01 00:10:44 UTC
README
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/qwen-php-client
Ensure your project meets the following requirements:
Requires PHP 8.1+
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.aliyuncs.com', 500) ->query('System setup query', 'system') ->query('User input message', 'user') ->withModel(Models::QWEN_VL_MAX->value) ->run(); echo 'API Response:'.$response;
License
Nacosvel Contracts is made available under the MIT License (MIT). Please see License File for more information.