Skip to content

New deployment migration fails if OpenAI key is not defined #113

@stardothosting

Description

@stardothosting

when running "php artisan migrate" per the installation instructions :

{
  OpenAI API key is not configured. Please set OPENAI_API_KEY in your .env file.

  at app/Services/OpenAIService.php:21
     17▕         $this->model = config('services.openai.model', 'gpt-4o-mini');
     18▕         $this->baseUrl = config('services.openai.base_url', 'https://api.openai.com/v1');
     19▕ 
     20▕         if (empty($this->apiKey)) {
  ➜  21▕             throw new \InvalidArgumentException('OpenAI API key is not configured. Please set OPENAI_API_KEY in your .env file.');
     22▕         }
     23▕     }
     24▕ 
     25▕     public function analyzeReviews(array $reviews): array

  1   [internal]:0
      App\Services\OpenAIService::__construct()
      +25 vendor frames 

  27  artisan:35
      Illuminate\Foundation\Console\Kernel::handle()

}

Originally posted by @xanun500 in #101

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions