PHP code example of shcherbanich / symfony-console-gpt
1. Go to this page and download the library: Download shcherbanich/symfony-console-gpt 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/ */
shcherbanich / symfony-console-gpt example snippets
use ConsoleGpt\Command\ChatCommand;
use Symfony\Component\Console\Application;
$application = new Application();
$application->add(new ChatCommand());
$application->run();
namespace MyApp\Console;
use ConsoleGpt\Application as ChatApplication;
final class SomeApp extends ChatApplication
{
// Add custom behavior here
}
bash
$ OPENAI_API_KEY='<your API key>' php demo/demo.php chat
bash
$ OPENAI_API_KEY='<your API key>' php console chat