PHP code example of elsayed85 / laravel-github-copilot-chat

1. Go to this page and download the library: Download elsayed85/laravel-github-copilot-chat 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/ */

    

elsayed85 / laravel-github-copilot-chat example snippets


return [
    'stream' => true,
    'intent' => false,
    'model' => 'copilot-chat',
    'temperature' => 0.1,
    'top_p' => 1,
    'n' => 1,

    'client_id' => '01ab8ac9400c4e429b23', // Don't change this
    'user_agent' => 'GithubCopilot/3.99.99', // Don't change this
];

use Elsayed85\CopilotChat\CopilotCli;

$cli = new CopilotCli();
$q = "install laravel";
$cli = $cli->init();
$cli->setQuestion($q);
$a = $cli->shell(); // you can use shell() or git() or gitCli()
// call explanation() after shell() or git() or gitCli() to get explanation of the generated cli command
$explanation = $cli->explanation();
dd($a , $explanation);
bash
php artisan vendor:publish --tag="laravel-github-copilot-chat-config"
bash
php artisan copilot:chat