We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For example, if you use a framework such as Symfony, you cannot use this part of the code, as Symfony blocks the getenv because it is not thread safe.
- "use_putenv" to tell Dotenv to set env vars using putenv() (NOT RECOMMENDED.) src/Symfony/Component/Runtime/SymfonyRuntime.php
- "use_putenv" to tell Dotenv to set env vars using putenv() (NOT RECOMMENDED.)
->usePutenv($options['use_putenv'] ?? false) src/Symfony/Component/Runtime/SymfonyRuntime.php
->usePutenv($options['use_putenv'] ?? false)
Should we therefore add another check to use the global $_ENV[""] for example to prevent duplicate configuration? Any opinions on this?
public function __construct(?OpenAIConfig $config = null) { if ($config instanceof OpenAIConfig && $config->client instanceof Client) { $this->client = $config->client; } else { $apiKey = $config->apiKey ?? getenv('OPENAI_API_KEY'); if (! $apiKey) { throw new Exception('You have to provide a OPENAI_API_KEY env var to request OpenAI .'); } $this->client = OpenAI::client($apiKey); } $this->model = $config->model ?? OpenAIChatModel::Gpt4Turbo->getModelName(); $this->modelOptions = $config->modelOptions ?? []; }
The text was updated successfully, but these errors were encountered:
RHosono
No branches or pull requests
For example, if you use a framework such as Symfony, you cannot use this part of the code, as Symfony blocks the getenv because it is not thread safe.
- "use_putenv" to tell Dotenv to set env vars using putenv() (NOT RECOMMENDED.)
src/Symfony/Component/Runtime/SymfonyRuntime.php
->usePutenv($options['use_putenv'] ?? false)
src/Symfony/Component/Runtime/SymfonyRuntime.php
Should we therefore add another check to use the global $_ENV[""] for example to prevent duplicate configuration? Any opinions on this?
The text was updated successfully, but these errors were encountered: