PHP code example of gingdev / iaskai

1. Go to this page and download the library: Download gingdev/iaskai library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gingdev / iaskai example snippets




use Gingdev\IAskAI\Client;

use function Amp\ByteStream\buffer;

$stream2 = $client->ask('Who is Light Yagami?');

echo buffer($stream1);

// streaming response
foreach ($stream2 as $chunk) {
    echo $chunk;
}