1. Go to this page and download the library: Download devdojo/ai 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/ */
devdojo / ai example snippets
$response = ai('What is the meaning of life?');
$response = ai('What color is the sky?', function($chunk){
// $chunk will contain the stream text response
});
Route::get('question', function(){
echo ai('What is the meaning of life?');
});
public function submit($input)
{
$this->output = ai($input, function($chunk){
logger($chunk);
});
}