diff --git a/api/chat.php b/api/chat.php index d2c8190..e2a50db 100644 --- a/api/chat.php +++ b/api/chat.php @@ -51,6 +51,7 @@ User's Answers: EOT; $prompt .= "\n" . implode("\n", $formatted_answers); + error_log('Attempting to call AI API for burnout analysis.'); $ai_response = LocalAIApi::createResponse([ 'input' => [ ['role' => 'system', 'content' => 'You are a burnout analysis expert.'], @@ -58,6 +59,8 @@ $prompt .= "\n" . implode("\n", $formatted_answers); ], ]); + error_log('AI API Response: ' . print_r($ai_response, true)); + if (!empty($ai_response['success'])) { $decoded_response = LocalAIApi::decodeJsonFromResponse($ai_response); $_SESSION['results'] = $decoded_response;