1. Go to this page and download the library: Download cognesy/instructor-config 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/ */
use Cognesy\Config\Config;
use Cognesy\Config\EnvTemplate;
use Cognesy\Config\Secrets\DotenvFileSecretSource;
use Cognesy\Config\Secrets\EnvironmentSecretSource;
use Cognesy\Config\Secrets\SecretResolver;
$secrets = new SecretResolver(
new EnvironmentSecretSource('process-environment'),
DotenvFileSecretSource::optional(__DIR__.'/.env', 'workspace-env'),
DotenvFileSecretSource::optional('/app/private/credentials.env', 'app-credentials'),
);
$entry = Config::fromPaths(__DIR__.'/config')
->withTemplate(new EnvTemplate($secrets))
->load('llm.yaml');
$source = $secrets->resolve('OPENAI_API_KEY')?->source;
use Cognesy\Config\Dsn;
$raw = Dsn::fromString('driver=openai,metadata.region=us-east-1')->toArray();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.