diff --git a/app/Services/AIAnalysisService.php b/app/Services/AIAnalysisService.php index 39014fc..9035f47 100644 --- a/app/Services/AIAnalysisService.php +++ b/app/Services/AIAnalysisService.php @@ -95,8 +95,8 @@ class AIAnalysisService $ollamaUrl = config('services.ollama.url', 'http://localhost:11434/api/generate'); try { - $response = Http::timeout(60)->post($ollamaUrl, [ - 'model' => 'mistral', // or llama3 + $response = Http::timeout(120)->post($ollamaUrl, [ + 'model' => 'mistral', 'prompt' => $prompt, 'stream' => false, 'format' => 'json' @@ -104,9 +104,11 @@ class AIAnalysisService if ($response->successful()) { return json_decode($response->json('response'), true); + } else { + Log::warning("AI Provider Error: HTTP " . $response->status() . " - " . $response->body()); } } catch (\Exception $e) { - Log::error("AI Analysis Call Failed: " . $e->getMessage()); + Log::error("AI Connection Failed (Ollama): " . $e->getMessage()); } // Fallback for demo if Ollama is not running