qwen-php / qwen-laravel
A seamless Laravel integration for the qwen PHP client, enabling effortless interaction with the qwen API in your Laravel applications.
Requires
- php: ^8.1.0
- illuminate/support: ^9.0|^10.0|^11.0
- nyholm/psr7: ^1.8
- qwen-php/qwen-php-client: ^1.0.1
- symfony/http-client: ^7.2
Requires (Dev)
- orchestra/testbench: ^7.0|^8.0
- phpunit/phpunit: ^9.0|^10.0
This package is auto-updated.
Last update: 2025-02-01 03:26:32 UTC
README
Laravel wrapper for qwen PHP client to seamless Alibaba qwen AI API integration with Laravel applications.
Table of Contents
Installation
You can install the package via composer:
composer require qwen-php/qwen-laravel
Publishing Configuration File
php artisan vendor:publish --tag=qwen
then add token to .env
file
QWEN_API_KEY="your_api_key"
Usage
Basic Usage
use QwenClient; $Qwen = app(QwenClient::class); $response = $Qwen->query('Hello qwen, I am Laravel Framework , how are you Today ^_^ ?')->run(); print_r("qwen API response : " . $response);
Note: In easy mode, it will take defaults for all configs Check Default Values
Advanced Usage
use QwenClient; $qwen = app(QwenClient::class); // Another way, with customization $response = $qwen ->query('Hello qwen, how are you ?', 'system') ->query('Hello qwen, my name is PHP ', 'user') ->withModel("qwen-vl-max") ->setTemperature(1.5) ->run(); print_r("qwen API response : " . $response);
Testing
Tests will come soon
Contributors ✨
Thanks to these wonderful people for contributing to this project! 💖
Want to contribute? Check out the contributing guidelines and submit a pull request! 🚀
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security
If you discover any security-related issues, please email omaralwi2010@gmail.com instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.