gingdev / iaskai
1.2.5
2024-11-14 03:37 UTC
Requires
- php: >=8.1
- amphp/http-client-cookies: ^2.0
- amphp/websocket-client: ^2.0
- league/html-to-markdown: ^5.1
- symfony/dom-crawler: ^7.1
- symfony/event-dispatcher: ^7.1
Requires (Dev)
- pestphp/pest: ^3.1
- phpstan/phpstan: ^1.12
README
The iAskAI PHP client is a simple and efficient way to interact with the IAskAI API, allowing developers to easily integrate AI-driven responses into their PHP applications.
Installation
composer require gingdev/iaskai
Usage
<?php use Gingdev\IAskAI\Client; use function Amp\ByteStream\buffer; require __DIR__.'/vendor/autoload.php'; $client = Client::create(); $stream1 = $client->ask('Who is Goku?'); $stream2 = $client->ask('Who is Light Yagami?'); echo buffer($stream1); // streaming response foreach ($stream2 as $chunk) { echo $chunk; }
Features
- Asynchronous Support: The client is designed to work with asynchronous programming, making it suitable for applications that require non-blocking I/O operations.
- Streaming Responses: The ability to handle streaming responses allows for real-time data processing and display, enhancing user experience.
- Easy Integration: The client is easy to integrate into existing PHP applications, requiring minimal setup.